<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.2.0">


  <link rel="apple-touch-icon" sizes="180x180" href="https://www.wulihub.com.cn/gc/Wez0VG/images/apple-touch-icon.png">
  <link rel="icon" type="image/png" sizes="32x32" href="https://www.wulihub.com.cn/gc/Wez0VG/images/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="https://www.wulihub.com.cn/gc/Wez0VG/images/favicon-16x16.png">
  <link rel="mask-icon" href="https://www.wulihub.com.cn/gc/Wez0VG/images/logo.svg" color="#222">

<link rel="stylesheet" href="https://www.wulihub.com.cn/gc/Wez0VG/css/main.css">



<link rel="stylesheet" href="https://npm.elemecdn.com/@fortawesome/fontawesome-free@6.1.1/css/all.min.css" integrity="sha256-DfWjNxDkM94fVBWx1H5BMMp0Zq7luBlV8QRcSES7s+0=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://npm.elemecdn.com/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"nobige.cn","root":"/","images":"https://www.wulihub.com.cn/gc/Wez0VG/images","scheme":"Gemini","darkmode":false,"version":"8.12.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":false,"style":null},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Searching...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/config.js"></script>

    <meta name="description" content="Photo by Julian Hochgesang on Unsplash Html禁用referer 本地网站html图片或链接,跳过,隐藏,,删除,禁用referer  123456789101112&lt;meta name&#x3D;&quot;referrer&quot; content&#x3D;&quot;never&quot;&gt;值的解释neveralwaysorigindefault1.如果">
<meta property="og:type" content="article">
<meta property="og:title" content="Html和Css及Js错误常用集合">
<meta property="og:url" content="https://nobige.cn/post/20200727-Html_he_Css_ji_Js_cuo_wu_chang_yong_ji_he/index.html">
<meta property="og:site_name" content="NoBige-JackCh3n">
<meta property="og:description" content="Photo by Julian Hochgesang on Unsplash Html禁用referer 本地网站html图片或链接,跳过,隐藏,,删除,禁用referer  123456789101112&lt;meta name&#x3D;&quot;referrer&quot; content&#x3D;&quot;never&quot;&gt;值的解释neveralwaysorigindefault1.如果">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200727-Html_he_Css_ji_Js_cuo_wu_chang_yong_ji_he/julian-hochgesang-u5krK0tBH8Y-unsplash.jpg">
<meta property="article:published_time" content="2020-07-27T07:52:43.000Z">
<meta property="article:modified_time" content="2024-11-07T02:59:06.306Z">
<meta property="article:author" content="JackCh3n">
<meta property="article:tag" content="js">
<meta property="article:tag" content="html">
<meta property="article:tag" content="css">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200727-Html_he_Css_ji_Js_cuo_wu_chang_yong_ji_he/julian-hochgesang-u5krK0tBH8Y-unsplash.jpg">


<link rel="canonical" href="https://nobige.cn/post/20200727-Html_he_Css_ji_Js_cuo_wu_chang_yong_ji_he/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"en","comments":true,"permalink":"https://nobige.cn/post/20200727-Html_he_Css_ji_Js_cuo_wu_chang_yong_ji_he/","path":"post/20200727-Html_he_Css_ji_Js_cuo_wu_chang_yong_ji_he/","title":"Html和Css及Js错误常用集合"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>Html和Css及Js错误常用集合 | NoBige-JackCh3n</title>
  
  <script class="next-config" data-name="google_analytics" type="application/json">{"tracking_id":"UA-122817633-1","only_pageview":true}</script>
  <script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/analytics/google-analytics.js"></script>

  <script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/analytics/baidu-analytics.js"></script>
  <script async src="https://hm.baidu.com/hm.js?96741f92c07d010c0ddd1d02197893e2"></script>




  <noscript>
    <link rel="stylesheet" href="https://www.wulihub.com.cn/gc/Wez0VG/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">NoBige-JackCh3n</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">copy to my blog</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="home fa-fw"></i>Home</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="user fa-fw"></i>About</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="tags fa-fw"></i>Tags</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="th fa-fw"></i>Categories</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="archive fa-fw"></i>Archives</a></li><li class="menu-item menu-item-sitemap"><a href="/sitemap.xml" rel="section"><i class="sitemap fa-fw"></i>Sitemap</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>Search
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="Searching..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Html"><span class="nav-number">1.</span> <span class="nav-text">Html</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%A6%81%E7%94%A8referer"><span class="nav-number">1.1.</span> <span class="nav-text">禁用referer</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%A1%A8%E5%8D%95%E7%A6%81%E6%AD%A2%E8%87%AA%E5%8A%A8%E5%A1%AB%E5%86%99"><span class="nav-number">1.2.</span> <span class="nav-text">表单禁止自动填写</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Css"><span class="nav-number">2.</span> <span class="nav-text">Css</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%96%87%E5%AD%97%E6%B0%B4%E5%B9%B3%E5%B1%85%E4%B8%AD"><span class="nav-number">2.1.</span> <span class="nav-text">文字水平居中</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%96%87%E6%9C%AC%E5%9E%82%E7%9B%B4%E6%B0%B4%E5%B9%B3%E5%B1%85%E4%B8%AD"><span class="nav-number">2.2.</span> <span class="nav-text">文本垂直水平居中</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%B8%85%E9%99%A4%E8%A1%A8%E6%A0%BC%E7%99%BD%E8%BE%B9"><span class="nav-number">2.3.</span> <span class="nav-text">清除表格白边</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%BC%A0%E6%A0%87%E6%A0%B7%E5%BC%8F%E4%BF%AE%E6%94%B9"><span class="nav-number">2.4.</span> <span class="nav-text">鼠标样式修改</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#div%E5%B1%85%E4%B8%AD%E7%9A%84%E5%87%A0%E7%A7%8D%E6%96%B9%E6%B3%95"><span class="nav-number">2.5.</span> <span class="nav-text">div居中的几种方法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%94%B9%E5%8F%98input%E6%A1%86%E4%B8%ADplaceholder%E9%A2%9C%E8%89%B2%E7%9A%84%E6%96%B9%E6%B3%95"><span class="nav-number">2.6.</span> <span class="nav-text">改变input框中placeholder颜色的方法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%88%A0%E9%99%A4%E8%B6%85%E9%93%BE%E6%8E%A5A%E6%A0%87%E7%AD%BE%E4%B8%8B%E5%88%92%E7%BA%BF"><span class="nav-number">2.7.</span> <span class="nav-text">删除超链接A标签下划线</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#css3%E5%9C%86%E8%A7%92"><span class="nav-number">2.8.</span> <span class="nav-text">css3圆角</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#css3%E7%9B%92%E5%AD%90%E9%98%B4%E5%BD%B1"><span class="nav-number">2.9.</span> <span class="nav-text">css3盒子阴影</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#rgba"><span class="nav-number">2.10.</span> <span class="nav-text">rgba</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#filter-%E6%BB%A4%E9%95%9C"><span class="nav-number">2.11.</span> <span class="nav-text">filter(滤镜)</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#outline%EF%BC%88%E8%BD%AE%E5%BB%93%EF%BC%89"><span class="nav-number">2.12.</span> <span class="nav-text">outline（轮廓）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%82%AC%E6%B5%AE%E6%8C%89%E9%92%AE"><span class="nav-number">2.13.</span> <span class="nav-text">悬浮按钮</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Js"><span class="nav-number">3.</span> <span class="nav-text">Js</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%B8%B8%E7%94%A8"><span class="nav-number">3.1.</span> <span class="nav-text">常用</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2"><span class="nav-number">3.2.</span> <span class="nav-text">类型转换</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#JavaScript-%E5%88%B7%E6%96%B0%E5%BD%93%E5%89%8D%E9%A1%B5%E9%9D%A2"><span class="nav-number">3.3.</span> <span class="nav-text">JavaScript 刷新当前页面</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#JavaScript%E8%8E%B7%E5%8F%96%E6%97%B6%E9%97%B4%E6%88%B3%E4%B8%8E%E6%97%B6%E9%97%B4%E6%88%B3%E8%BD%AC%E5%8C%96"><span class="nav-number">3.4.</span> <span class="nav-text">JavaScript获取时间戳与时间戳转化</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#JS%E8%AE%BE%E7%BD%AECSS%E6%A0%B7%E5%BC%8F%E7%9A%84%E5%87%A0%E7%A7%8D%E6%96%B9%E5%BC%8F"><span class="nav-number">3.5.</span> <span class="nav-text">JS设置CSS样式的几种方式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%AA%9A%E6%93%8D%E4%BD%9C"><span class="nav-number">3.6.</span> <span class="nav-text">骚操作</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%A5%87%E5%81%B6%E6%95%B0%E5%88%A4%E6%96%AD"><span class="nav-number">3.7.</span> <span class="nav-text">奇偶数判断</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%88%A4%E6%96%AD%E6%98%AF%E5%90%A6%E4%B8%BA%E7%A9%BANull"><span class="nav-number">3.8.</span> <span class="nav-text">判断是否为空Null</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%97%B6%E9%97%B4%E6%88%B3%E8%BD%AC%E6%97%A5%E6%9C%9F"><span class="nav-number">3.9.</span> <span class="nav-text">时间戳转日期</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#javascript%E4%B9%A6%E7%AD%BE"><span class="nav-number">3.10.</span> <span class="nav-text">javascript书签</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#html%E6%8B%BC%E6%8E%A5"><span class="nav-number">3.11.</span> <span class="nav-text">html拼接</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%85%B3%E9%94%AE%E8%AF%8D"><span class="nav-number">3.12.</span> <span class="nav-text">关键词</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%A6%81%E6%AD%A2Debug"><span class="nav-number">3.13.</span> <span class="nav-text">禁止Debug</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%8E%B7%E5%8F%96URL%E5%8F%82%E6%95%B0"><span class="nav-number">3.14.</span> <span class="nav-text">获取URL参数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%95%B0%E7%BB%84%E8%BD%ACURL%E5%8F%82%E6%95%B0"><span class="nav-number">3.15.</span> <span class="nav-text">数组转URL参数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Arguments-%E5%AF%B9%E8%B1%A1"><span class="nav-number">3.16.</span> <span class="nav-text">Arguments 对象</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Object-keys"><span class="nav-number">3.17.</span> <span class="nav-text">Object.keys()</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Object-prototype-hasOwnProperty"><span class="nav-number">3.18.</span> <span class="nav-text">Object.prototype.hasOwnProperty()</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Array-prototype-map"><span class="nav-number">3.19.</span> <span class="nav-text">Array.prototype.map()</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Array-prototype-filter"><span class="nav-number">3.20.</span> <span class="nav-text">Array.prototype.filter()</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#for%E2%80%A6in"><span class="nav-number">3.21.</span> <span class="nav-text">for…in</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%96%B9%E6%B3%95"><span class="nav-number">3.22.</span> <span class="nav-text">方法</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Document"><span class="nav-number">3.23.</span> <span class="nav-text">Document</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Jquery"><span class="nav-number">4.</span> <span class="nav-text">Jquery</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BB%A3%E6%9B%BFjs%E5%AD%97%E7%AC%A6%E6%8B%BC%E6%8E%A5"><span class="nav-number">4.1.</span> <span class="nav-text">代替js字符拼接</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%A1%A8%E5%8D%95%E9%87%8D%E7%BD%AE"><span class="nav-number">5.</span> <span class="nav-text">表单重置</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Layui"><span class="nav-number">6.</span> <span class="nav-text">Layui</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#layui%E6%B8%85%E7%A9%BA-%E9%87%8D%E7%BD%AE%E8%A1%A8%E5%8D%95%E6%95%B0%E6%8D%AE%E7%9A%84%E6%95%B0%E6%8D%AE"><span class="nav-number">6.1.</span> <span class="nav-text">layui清空,重置表单数据的数据</span></a></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="JackCh3n"
      src="https://www.wulihub.com.cn/gc/Wez0VG/images/avatar.png">
  <p class="site-author-name" itemprop="name">JackCh3n</p>
  <div class="site-description" itemprop="description">Record the pit filling process with words</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">146</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">279</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author site-overview-item animated">
      <span class="links-of-author-item">
        <a href="https://github.com/jackch3n" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;jackch3n" rel="noopener" target="_blank"><i class="github fa-fw"></i>GitHub</a>
      </span>
  </div>


  <div class="links-of-blogroll site-overview-item animated">
    <div class="links-of-blogroll-title"><i class="fa fa-globe fa-fw"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://vercel.com/?f=nobige" title="https:&#x2F;&#x2F;vercel.com?f&#x3D;nobige" rel="noopener" target="_blank">vercel</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.jsdelivr.com/?f=nobige" title="https:&#x2F;&#x2F;www.jsdelivr.com?f&#x3D;nobige" rel="noopener" target="_blank">jsdelivr</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.upyun.com/?f=nobige" title="https:&#x2F;&#x2F;www.upyun.com?f&#x3D;nobige" rel="noopener" target="_blank">upyun</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://coding.net/?f=nobige" title="https:&#x2F;&#x2F;coding.net?f&#x3D;nobige" rel="noopener" target="_blank">coding</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://unsplash.com/?f=nobige" title="https:&#x2F;&#x2F;unsplash.com?f&#x3D;nobige" rel="noopener" target="_blank">unsplash</a>
        </li>
    </ul>
  </div>

        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="Back to top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="en">
    <link itemprop="mainEntityOfPage" href="https://nobige.cn/post/20200727-Html_he_Css_ji_Js_cuo_wu_chang_yong_ji_he/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://www.wulihub.com.cn/gc/Wez0VG/images/avatar.png">
      <meta itemprop="name" content="JackCh3n">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="NoBige-JackCh3n">
      <meta itemprop="description" content="Record the pit filling process with words">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="Html和Css及Js错误常用集合 | NoBige-JackCh3n">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Html和Css及Js错误常用集合
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2020-07-27 15:52:43" itemprop="dateCreated datePublished" datetime="2020-07-27T15:52:43+08:00">2020-07-27</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">Edited on</span>
      <time title="Modified: 2024-11-07 10:59:06" itemprop="dateModified" datetime="2024-11-07T10:59:06+08:00">2024-11-07</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">In</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E9%94%99%E8%AF%AF/" itemprop="url" rel="index"><span itemprop="name">错误</span></a>
        </span>
    </span>

  
    <span class="post-meta-item" title="Views" id="busuanzi_container_page_pv">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">Views: </span>
      <span id="busuanzi_value_page_pv"></span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20200727-Html_he_Css_ji_Js_cuo_wu_chang_yong_ji_he/julian-hochgesang-u5krK0tBH8Y-unsplash.jpg" alt="car"></p>
<p><em>Photo by Julian Hochgesang on <a href="/go.html?u=https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a></em></p>
<h2 id="Html"><a href="#Html" class="headerlink" title="Html"></a>Html</h2><h3 id="禁用referer"><a href="#禁用referer" class="headerlink" title="禁用referer"></a>禁用referer</h3><blockquote>
<p>本地网站html图片或链接,跳过,隐藏,,删除,禁用referer</p>
</blockquote>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">meta</span> <span class="attr">name</span>=<span class="string">&quot;referrer&quot;</span> <span class="attr">content</span>=<span class="string">&quot;never&quot;</span>&gt;</span></span><br><span class="line">值的解释</span><br><span class="line">never</span><br><span class="line">always</span><br><span class="line">origin</span><br><span class="line">default</span><br><span class="line">1.如果 referer-policy 的值为never：删除 http head 中的 referer；</span><br><span class="line">2.如果 referer-policy 的值为default：如果当前页面使用的是 https 协议，而正要加载的资源使用的是普通的 http 协议，则将 http header 中的 referer 置为空；</span><br><span class="line">3.如果 referer-policy 的值为 origin：只发送 origin 部分；</span><br><span class="line">4.如果 referer-policy 的值为 always：不改变http header 中的 referer 的值，注意：这种情况下，如果当前页面使用了 https 协议，而要加载的资源使用的是 http 协议，加载资源的请求头中也会携带 referer。</span><br><span class="line">————————————————</span><br><span class="line">参考链接：https://blog.csdn.net/weixin_43627766/java/article/details/90311889</span><br></pre></td></tr></table></figure>

<h3 id="表单禁止自动填写"><a href="#表单禁止自动填写" class="headerlink" title="表单禁止自动填写"></a>表单禁止自动填写</h3><p>如何禁止注册表单的自动填写邮箱、密码</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">语法</span><br><span class="line">&lt;input autocomplete=&quot;on|off&quot;&gt;</span><br><span class="line">属性值</span><br><span class="line">值	描述</span><br><span class="line">on	默认。规定启用自动完成功能。</span><br><span class="line">off	规定禁用自动完成功能。</span><br><span class="line">实例</span><br><span class="line">启用自动完成功能的 HTML 表单（其中一个输入字段禁用了自动完成）：</span><br><span class="line">&lt;form action=&quot;demo_form.html&quot; autocomplete=&quot;on&quot;&gt;</span><br><span class="line">First name:&lt;input type=&quot;text&quot; name=&quot;fname&quot;&gt;&lt;br&gt;</span><br><span class="line">Last name: &lt;input type=&quot;text&quot; name=&quot;lname&quot;&gt;&lt;br&gt;</span><br><span class="line">E-mail: &lt;input type=&quot;email&quot; name=&quot;email&quot; autocomplete=&quot;off&quot;&gt;&lt;br&gt;</span><br><span class="line">&lt;input type=&quot;submit&quot;&gt;</span><br><span class="line">&lt;/form&gt;</span><br><span class="line">————————————————</span><br><span class="line">参考链接：https://www.runoob.com/tags/att-input-autocomplete.html</span><br></pre></td></tr></table></figure>

<h2 id="Css"><a href="#Css" class="headerlink" title="Css"></a>Css</h2><h3 id="文字水平居中"><a href="#文字水平居中" class="headerlink" title="文字水平居中"></a>文字水平居中</h3><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">&quot;text-align: center;&quot;</span>&gt;</span>文字水平居中<span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br></pre></td></tr></table></figure>

<h3 id="文本垂直水平居中"><a href="#文本垂直水平居中" class="headerlink" title="文本垂直水平居中"></a>文本垂直水平居中</h3><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">&quot;width:200px;height:100px;line-height: 100px;&quot;</span>&gt;</span>文本垂直水平居中<span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">&quot;vertical-align: middle&quot;</span>&gt;</span>文本垂直水平居中<span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br></pre></td></tr></table></figure>

<h3 id="清除表格白边"><a href="#清除表格白边" class="headerlink" title="清除表格白边"></a>清除表格白边</h3><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">table</span>&#123;</span><br><span class="line">    <span class="attribute">border-collapse</span>: collapse;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="鼠标样式修改"><a href="#鼠标样式修改" class="headerlink" title="鼠标样式修改"></a>鼠标样式修改</h3><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*url 需使用的自定义光标的 URL。</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">注释：请在此列表的末端始终定义一种普通的光标，以防没有由 URL 定义的可用光标。</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">default 默认光标（通常是一个箭头）</span></span><br><span class="line"><span class="comment">auto    默认。浏览器设置的光标。</span></span><br><span class="line"><span class="comment">crosshair   光标呈现为十字线。</span></span><br><span class="line"><span class="comment">pointer 光标呈现为指示链接的指针（一只手）</span></span><br><span class="line"><span class="comment">move    此光标指示某对象可被移动。</span></span><br><span class="line"><span class="comment">e-resize    此光标指示矩形框的边缘可被向右（东）移动。</span></span><br><span class="line"><span class="comment">ne-resize   此光标指示矩形框的边缘可被向上及向右移动（北/东）。</span></span><br><span class="line"><span class="comment">nw-resize   此光标指示矩形框的边缘可被向上及向左移动（北/西）。</span></span><br><span class="line"><span class="comment">n-resize    此光标指示矩形框的边缘可被向上（北）移动。</span></span><br><span class="line"><span class="comment">se-resize   此光标指示矩形框的边缘可被向下及向右移动（南/东）。</span></span><br><span class="line"><span class="comment">sw-resize   此光标指示矩形框的边缘可被向下及向左移动（南/西）。</span></span><br><span class="line"><span class="comment">s-resize    此光标指示矩形框的边缘可被向下移动（南）。</span></span><br><span class="line"><span class="comment">w-resize    此光标指示矩形框的边缘可被向左移动（西）。</span></span><br><span class="line"><span class="comment">text    此光标指示文本。</span></span><br><span class="line"><span class="comment">wait    此光标指示程序正忙（通常是一只表或沙漏）。</span></span><br><span class="line"><span class="comment">help    此光标指示可用的帮助（通常是一个问号或一个气球）。*/</span></span><br><span class="line"><span class="selector-tag">span</span>&#123;</span><br><span class="line">	<span class="attribute">cursor</span>: pointer;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h3 id="div居中的几种方法"><a href="#div居中的几种方法" class="headerlink" title="div居中的几种方法"></a>div居中的几种方法</h3><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*绝对定位和0*/</span></span><br><span class="line"><span class="selector-class">.box</span>&#123;</span><br><span class="line">    <span class="attribute">width</span>:<span class="number">50%</span>;</span><br><span class="line">    <span class="attribute">height</span>: <span class="number">50%</span>;</span><br><span class="line">    <span class="attribute">position</span>: absolute;</span><br><span class="line">    <span class="attribute">background</span>:red;</span><br><span class="line">    <span class="attribute">margin</span>: auto;</span><br><span class="line">    <span class="attribute">top</span>:<span class="number">0</span>;</span><br><span class="line">    <span class="attribute">bottom</span>:<span class="number">0</span>;</span><br><span class="line">    <span class="attribute">left</span>:<span class="number">0</span>;</span><br><span class="line">    <span class="attribute">right</span>:<span class="number">0</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">/*flex布局*/</span></span><br><span class="line">&lt;!DOCTYPE <span class="selector-tag">html</span>&gt;</span><br><span class="line">&lt;<span class="selector-tag">html</span>&gt;</span><br><span class="line">&lt;head&gt;</span><br><span class="line">    &lt;meta charset=&quot;utf-<span class="number">8</span>&quot;&gt;</span><br><span class="line">    &lt;title&gt;登陆&lt;/title&gt;</span><br><span class="line">    &lt;style type=&quot;text/css&quot;&gt;</span><br><span class="line">        <span class="selector-tag">html</span>&#123;<span class="attribute">width</span>: <span class="number">100%</span>;<span class="attribute">height</span>: <span class="number">100%</span>;&#125;  <span class="comment">/*整个页面的居中*/</span></span><br><span class="line">        <span class="selector-tag">body</span>&#123;</span><br><span class="line">            <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">            <span class="attribute">height</span>: <span class="number">100%</span>;</span><br><span class="line">            <span class="attribute">display</span>: flex;             <span class="comment">/*flex弹性布局*/</span></span><br><span class="line">            <span class="attribute">justify-content</span>: center;</span><br><span class="line">            <span class="attribute">align-items</span>: center;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="selector-id">#login</span>&#123;</span><br><span class="line">            <span class="attribute">width</span>: <span class="number">300px</span>;</span><br><span class="line">            <span class="attribute">height</span>: <span class="number">300px</span>;</span><br><span class="line">            <span class="attribute">border</span>: <span class="number">1px</span> black solid;</span><br><span class="line">            <span class="attribute">display</span>: flex;</span><br><span class="line">            <span class="attribute">flex-direction</span>: column;        <span class="comment">/*元素的排列方向为垂直*/</span></span><br><span class="line">            <span class="attribute">justify-content</span>: center;    <span class="comment">/*水平居中对齐*/</span></span><br><span class="line">            <span class="attribute">align-items</span>: center;        <span class="comment">/*垂直居中对齐*/</span></span><br><span class="line">        &#125;</span><br><span class="line">    &lt;/style&gt;</span><br><span class="line">&lt;/head&gt;</span><br><span class="line">&lt;<span class="selector-tag">body</span>&gt;</span><br><span class="line">    &lt;<span class="selector-tag">div</span> id=&quot;login&quot;&gt;</span><br><span class="line">        &lt;<span class="selector-tag">h1</span>&gt;登陆&lt;/<span class="selector-tag">h1</span>&gt;</span><br><span class="line">        &lt;<span class="selector-tag">input</span> type=&quot;text&quot;&gt;&lt;br&gt;</span><br><span class="line">        &lt;<span class="selector-tag">input</span> type=&quot;password&quot;&gt;&lt;br&gt;</span><br><span class="line">        &lt;<span class="selector-tag">button</span>&gt;确定&lt;/<span class="selector-tag">button</span>&gt;</span><br><span class="line">    &lt;/<span class="selector-tag">div</span>&gt;</span><br><span class="line">&lt;/<span class="selector-tag">body</span>&gt;</span><br><span class="line">&lt;/<span class="selector-tag">html</span>&gt;</span><br><span class="line">————————————————</span><br><span class="line">参考链接：https://www.cnblogs.com/jing-tian/p/<span class="number">10969887</span>.html</span><br></pre></td></tr></table></figure>



<h3 id="改变input框中placeholder颜色的方法"><a href="#改变input框中placeholder颜色的方法" class="headerlink" title="改变input框中placeholder颜色的方法"></a>改变input框中placeholder颜色的方法</h3><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">input</span>::-webkit-input-placeholder &#123; <span class="comment">/* WebKit browsers 适配谷歌 */</span></span><br><span class="line">    <span class="attribute">color</span>: <span class="number">#BDCADA</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-tag">input</span>:-moz-placeholder &#123; <span class="comment">/* Mozilla Firefox 4 to 18 适配火狐 */</span></span><br><span class="line">    <span class="attribute">color</span>: <span class="number">#BDCADA</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-tag">input</span>::-moz-placeholder &#123; <span class="comment">/* Mozilla Firefox 19+ 适配火狐 */</span></span><br><span class="line">    <span class="attribute">color</span>: <span class="number">#BDCADA</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-tag">input</span>:-ms-input-placeholder &#123; <span class="comment">/* Internet Explorer 10+  适配ie*/</span></span><br><span class="line">    <span class="attribute">color</span>: <span class="number">#BDCADA</span>;</span><br><span class="line">&#125;</span><br><span class="line">————————————————</span><br><span class="line">参考链接：https://blog.csdn.net/zeyu1021/article/details/<span class="number">44563393</span></span><br></pre></td></tr></table></figure>



<h3 id="删除超链接A标签下划线"><a href="#删除超链接A标签下划线" class="headerlink" title="删除超链接A标签下划线"></a>删除超链接A标签下划线</h3><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">a</span><span class="selector-pseudo">:link</span>,<span class="selector-tag">a</span><span class="selector-pseudo">:visited</span>&#123;</span><br><span class="line"> <span class="attribute">text-decoration</span>:none;  <span class="comment">/*超链接无下划线*/</span></span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-tag">a</span><span class="selector-pseudo">:hover</span>&#123;</span><br><span class="line"> <span class="attribute">text-decoration</span>:underline;  <span class="comment">/*鼠标放上去有下划线*/</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h3 id="css3圆角"><a href="#css3圆角" class="headerlink" title="css3圆角"></a>css3圆角</h3><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">border-radius</span>:上 右 下 左;</span><br><span class="line"><span class="attribute">border-radius</span>: <span class="number">15px</span> <span class="number">50px</span> <span class="number">30px</span> <span class="number">5px</span>:</span><br></pre></td></tr></table></figure>



<h3 id="css3盒子阴影"><a href="#css3盒子阴影" class="headerlink" title="css3盒子阴影"></a>css3盒子阴影</h3><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">值	说明</span><br><span class="line">h-shadow	必需的。水平阴影的位置。允许负值</span><br><span class="line">v-shadow	必需的。垂直阴影的位置。允许负值</span><br><span class="line">blur	可选。模糊距离</span><br><span class="line">spread	可选。阴影的大小</span><br><span class="line"><span class="attribute">color</span>	可选。阴影的颜色。在CSS颜色值寻找颜色值的完整列表</span><br><span class="line">inset	可选。从外层的阴影（开始时）改变阴影内侧阴影</span><br><span class="line"></span><br><span class="line"><span class="attribute">box-shadow</span>: <span class="number">10px</span> <span class="number">10px</span> <span class="number">5px</span> <span class="number">#888888</span>;</span><br><span class="line">————————————————</span><br><span class="line">参考链接：https://www.runoob.com/cssref/css3-pr-box-shadow.html</span><br></pre></td></tr></table></figure>



<h3 id="rgba"><a href="#rgba" class="headerlink" title="rgba"></a>rgba</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">值	描述</span><br><span class="line">red	定义红色值，取值范围为 0 ~ 255，也可以使用百分比 0% ~ 100%。</span><br><span class="line">green	定义绿色值，取值范围为 0 ~ 255，也可以使用百分比 0% ~ 100%。</span><br><span class="line">blue	定义蓝色值，取值范围为 0 ~ 255，也可以使用百分比 0% ~ 100%。</span><br><span class="line"></span><br><span class="line">alpha - 透明度	定义透明度 0（透完全明） ~ 1（完全不透明）</span><br><span class="line">————————————————</span><br><span class="line">参考链接：https://www.runoob.com/cssref/func-rgba.html</span><br></pre></td></tr></table></figure>

<h3 id="filter-滤镜"><a href="#filter-滤镜" class="headerlink" title="filter(滤镜)"></a>filter(滤镜)</h3><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">默认值:	none</span><br><span class="line">继承:		no</span><br><span class="line">动画支持:	是。详细可查阅 CSS 动画 https://www.runoob.com/cssref/css-animatable.html</span><br><span class="line">版本:		CSS3</span><br><span class="line">JavaScript 语法:		object.style.WebkitFilter=<span class="string">&quot;grayscale(100%)&quot;</span> </span><br><span class="line"></span><br><span class="line">高斯模糊</span><br><span class="line">img &#123;</span><br><span class="line">    -webkit-<span class="attribute">filter</span>: <span class="built_in">blur</span>(<span class="number">5px</span>); <span class="comment">/* Chrome, Safari, Opera */</span></span><br><span class="line">    <span class="attribute">filter</span>: <span class="built_in">blur</span>(<span class="number">5px</span>);</span><br><span class="line">&#125;</span><br><span class="line">————————————————</span><br><span class="line">日期:<span class="number">2020</span>/<span class="number">10</span>/<span class="number">22</span></span><br><span class="line">参考链接：https://www.runoob.com/cssref/css3-pr-filter.html</span><br></pre></td></tr></table></figure>

<h3 id="outline（轮廓）"><a href="#outline（轮廓）" class="headerlink" title="outline（轮廓）"></a>outline（轮廓）</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">属性值</span><br><span class="line">值	描述</span><br><span class="line">outline-color	规定边框的颜色。参阅：outline-color 中可能的值。</span><br><span class="line">outline-style	规定边框的样式。参阅：outline-style 中可能的值。</span><br><span class="line">outline-width	规定边框的宽度。参阅：outline-width 中可能的值。</span><br><span class="line">inherit	规定应该从父元素继承 outline 属性的设置。</span><br><span class="line"></span><br><span class="line">input&#123;</span><br><span class="line">	outline:#00FF00 dotted thick;</span><br><span class="line">&#125;</span><br><span class="line">————————————————</span><br><span class="line">日期:2020/10/22</span><br><span class="line">参考链接：https://www.runoob.com/cssref/pr-outline.html</span><br></pre></td></tr></table></figure>

<h3 id="悬浮按钮"><a href="#悬浮按钮" class="headerlink" title="悬浮按钮"></a>悬浮按钮</h3><blockquote>
<p>transform: translateX(-50%); 重点，不然左右不能居中</p>
</blockquote>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.float-btn</span>&#123;</span><br><span class="line">  <span class="attribute">position</span>: fixed;</span><br><span class="line">  <span class="attribute">bottom</span>: <span class="number">30px</span>;</span><br><span class="line">  <span class="attribute">left</span>: <span class="number">50%</span>;</span><br><span class="line">  <span class="attribute">right</span>: <span class="number">50%</span>;</span><br><span class="line">  <span class="attribute">border</span>: solid <span class="number">1px</span> <span class="number">#666</span>;</span><br><span class="line">  <span class="attribute">border-radius</span>: <span class="number">30px</span>;</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">50px</span>;</span><br><span class="line">  <span class="attribute">height</span>: <span class="number">30px</span>;</span><br><span class="line">  <span class="attribute">text-align</span>: center;</span><br><span class="line">  <span class="attribute">line-height</span>: <span class="number">30px</span>;</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">0</span> <span class="number">10px</span>;</span><br><span class="line">  <span class="attribute">transform</span>: <span class="built_in">translateX</span>(-<span class="number">50%</span>);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h2 id="Js"><a href="#Js" class="headerlink" title="Js"></a>Js</h2><h3 id="常用"><a href="#常用" class="headerlink" title="常用"></a>常用</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 字符串转数组</span></span><br><span class="line"><span class="string">&#x27;nobige.cn&#x27;</span>.<span class="title function_">split</span>(<span class="string">&#x27;.&#x27;</span>)</span><br><span class="line"><span class="comment">// 数组转字符串	</span></span><br><span class="line">[<span class="string">&#x27;nobige&#x27;</span>,<span class="string">&#x27;cn&#x27;</span>].<span class="title function_">join</span>(<span class="string">&#x27;.&#x27;</span>)</span><br></pre></td></tr></table></figure>

<h3 id="类型转换"><a href="#类型转换" class="headerlink" title="类型转换"></a>类型转换</h3><blockquote>
<p>类型转换,Number() 转换为数字， String() 转换为字符串， Boolean() 转化为布尔值。</p>
</blockquote>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//查看类型</span></span><br><span class="line"><span class="comment">//	typeof 操作符来查看 JavaScript 变量的数据类型</span></span><br><span class="line"><span class="keyword">typeof</span> <span class="string">&quot;John&quot;</span>                 <span class="comment">// 返回 string</span></span><br><span class="line"><span class="keyword">typeof</span> <span class="number">3.14</span>                   <span class="comment">// 返回 number</span></span><br><span class="line"><span class="keyword">typeof</span> <span class="title class_">NaN</span>                    <span class="comment">// 返回 number</span></span><br><span class="line"><span class="keyword">typeof</span> <span class="literal">false</span>                  <span class="comment">// 返回 boolean</span></span><br><span class="line"><span class="keyword">typeof</span> [<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>,<span class="number">4</span>]              <span class="comment">// 返回 object</span></span><br><span class="line"><span class="keyword">typeof</span> &#123;<span class="attr">name</span>:<span class="string">&#x27;John&#x27;</span>, <span class="attr">age</span>:<span class="number">34</span>&#125;  <span class="comment">// 返回 object</span></span><br><span class="line"><span class="keyword">typeof</span> <span class="keyword">new</span> <span class="title class_">Date</span>()             <span class="comment">// 返回 object</span></span><br><span class="line"><span class="keyword">typeof</span> <span class="keyword">function</span> (<span class="params"></span>) &#123;&#125;         <span class="comment">// 返回 function</span></span><br><span class="line"><span class="keyword">typeof</span> myCar                  <span class="comment">// 返回 undefined (如果 myCar 没有声明)</span></span><br><span class="line"><span class="keyword">typeof</span> <span class="literal">null</span>                   <span class="comment">// 返回 object</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//	constructor 属性返回所有 JavaScript 变量的构造函数。</span></span><br><span class="line"><span class="string">&quot;John&quot;</span>.<span class="property">constructor</span>                 <span class="comment">// 返回函数 String()  &#123; [native code] &#125;</span></span><br><span class="line">(<span class="number">3.14</span>).<span class="property">constructor</span>                 <span class="comment">// 返回函数 Number()  &#123; [native code] &#125;</span></span><br><span class="line"><span class="literal">false</span>.<span class="property">constructor</span>                  <span class="comment">// 返回函数 Boolean() &#123; [native code] &#125;</span></span><br><span class="line">[<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>,<span class="number">4</span>].<span class="property">constructor</span>              <span class="comment">// 返回函数 Array()   &#123; [native code] &#125;</span></span><br><span class="line">&#123;<span class="attr">name</span>:<span class="string">&#x27;John&#x27;</span>, <span class="attr">age</span>:<span class="number">34</span>&#125;.<span class="property">constructor</span>  <span class="comment">// 返回函数 Object()  &#123; [native code] &#125;</span></span><br><span class="line"><span class="keyword">new</span> <span class="title class_">Date</span>().<span class="property">constructor</span>             <span class="comment">// 返回函数 Date()    &#123; [native code] &#125;</span></span><br><span class="line"><span class="keyword">function</span> (<span class="params"></span>) &#123;&#125;.<span class="property">constructor</span>         <span class="comment">// 返回函数 Function()&#123; [native code] &#125;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//将数字,布尔值转换为字符串</span></span><br><span class="line"><span class="comment">//	全局方法 String() 可以将数字转换为字符串。</span></span><br><span class="line"><span class="comment">//	该方法可用于任何类型的数字，字母，变量，表达式：</span></span><br><span class="line"><span class="comment">//实例</span></span><br><span class="line"><span class="title class_">String</span>(x)         <span class="comment">// 将变量 x 转换为字符串并返回</span></span><br><span class="line"><span class="title class_">String</span>(<span class="number">123</span>)       <span class="comment">// 将数字 123 转换为字符串并返回</span></span><br><span class="line"><span class="title class_">String</span>(<span class="number">100</span> + <span class="number">23</span>)  <span class="comment">// 将数字表达式转换为字符串并返回</span></span><br><span class="line"><span class="title class_">String</span>(<span class="literal">false</span>)        <span class="comment">// 返回 &quot;false&quot;</span></span><br><span class="line"><span class="title class_">String</span>(<span class="literal">true</span>)         <span class="comment">// 返回 &quot;true&quot;</span></span><br><span class="line"><span class="title class_">Date</span>()      <span class="comment">// 返回 Thu Jul 17 2014 15:38:19 GMT+0200 (W. Europe Daylight Time)</span></span><br><span class="line"><span class="title class_">String</span>(<span class="keyword">new</span> <span class="title class_">Date</span>())      <span class="comment">// 返回 Thu Jul 17 2014 15:38:19 GMT+0200 (W. Europe Daylight Time)</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//将数字,布尔值,日期转换为字符串</span></span><br><span class="line">x.<span class="title function_">toString</span>()</span><br><span class="line">(<span class="number">123</span>).<span class="title function_">toString</span>()</span><br><span class="line">(<span class="number">100</span> + <span class="number">23</span>).<span class="title function_">toString</span>()</span><br><span class="line"><span class="literal">false</span>.<span class="title function_">toString</span>()     <span class="comment">// 返回 &quot;false&quot;</span></span><br><span class="line"><span class="literal">true</span>.<span class="title function_">toString</span>()      <span class="comment">// 返回 &quot;true&quot;</span></span><br><span class="line">(<span class="keyword">new</span> <span class="title class_">Date</span>()).<span class="title function_">toString</span>()   <span class="comment">// 返回 Thu Jul 17 2014 15:38:19 GMT+0200 (W. Europe Daylight Time)</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//方法	描述</span></span><br><span class="line"><span class="title function_">toExponential</span>()	把对象的值转换为指数计数法。</span><br><span class="line"><span class="title function_">toFixed</span>()	把数字转换为字符串，结果的小数点后有指定位数的数字。</span><br><span class="line"><span class="title function_">toPrecision</span>()	把数字格式化为指定的长度。</span><br><span class="line"></span><br><span class="line"><span class="comment">//Date方法</span></span><br><span class="line"><span class="comment">//方法	描述</span></span><br><span class="line"><span class="title function_">getDate</span>()	从 <span class="title class_">Date</span> 对象返回一个月中的某一天 (<span class="number">1</span> ~ <span class="number">31</span>)。</span><br><span class="line"><span class="title function_">getDay</span>()	从 <span class="title class_">Date</span> 对象返回一周中的某一天 (<span class="number">0</span> ~ <span class="number">6</span>)。</span><br><span class="line"><span class="title function_">getFullYear</span>()	从 <span class="title class_">Date</span> 对象以四位数字返回年份。</span><br><span class="line"><span class="title function_">getHours</span>()	返回 <span class="title class_">Date</span> 对象的小时 (<span class="number">0</span> ~ <span class="number">23</span>)。</span><br><span class="line"><span class="title function_">getMilliseconds</span>()	返回 <span class="title class_">Date</span> 对象的毫秒(<span class="number">0</span> ~ <span class="number">999</span>)。</span><br><span class="line"><span class="title function_">getMinutes</span>()	返回 <span class="title class_">Date</span> 对象的分钟 (<span class="number">0</span> ~ <span class="number">59</span>)。</span><br><span class="line"><span class="title function_">getMonth</span>()	从 <span class="title class_">Date</span> 对象返回月份 (<span class="number">0</span> ~ <span class="number">11</span>)。</span><br><span class="line"><span class="title function_">getSeconds</span>()	返回 <span class="title class_">Date</span> 对象的秒数 (<span class="number">0</span> ~ <span class="number">59</span>)。</span><br><span class="line"><span class="title function_">getTime</span>()	返回 <span class="number">1970</span> 年 <span class="number">1</span> 月 <span class="number">1</span> 日至今的毫秒数。</span><br><span class="line"></span><br><span class="line"><span class="comment">//将字符串转换为数字</span></span><br><span class="line"><span class="title class_">Number</span>(<span class="string">&quot;3.14&quot;</span>)    <span class="comment">// 返回 3.14</span></span><br><span class="line"><span class="title class_">Number</span>(<span class="string">&quot; &quot;</span>)       <span class="comment">// 返回 0</span></span><br><span class="line"><span class="title class_">Number</span>(<span class="string">&quot;&quot;</span>)        <span class="comment">// 返回 0</span></span><br><span class="line"><span class="title class_">Number</span>(<span class="string">&quot;99 88&quot;</span>)   <span class="comment">// 返回 NaN</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//方法	描述</span></span><br><span class="line"><span class="built_in">parseFloat</span>()	解析一个字符串，并返回一个浮点数。</span><br><span class="line"><span class="built_in">parseInt</span>()	解析一个字符串，并返回一个整数。</span><br><span class="line"></span><br><span class="line"><span class="comment">//将布尔值转换为数字</span></span><br><span class="line"><span class="comment">//全局方法 Number() 可将布尔值转换为数字。</span></span><br><span class="line"><span class="title class_">Number</span>(<span class="literal">false</span>)     <span class="comment">// 返回 0</span></span><br><span class="line"><span class="title class_">Number</span>(<span class="literal">true</span>)      <span class="comment">// 返回 1</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//将日期转换为数字</span></span><br><span class="line"><span class="comment">//	全局方法 Number() 可将日期转换为数字。</span></span><br><span class="line">d = <span class="keyword">new</span> <span class="title class_">Date</span>();</span><br><span class="line"><span class="title class_">Number</span>(d)          <span class="comment">// 返回 1404568027739</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//	日期方法 getTime() 也有相同的效果。</span></span><br><span class="line">d = <span class="keyword">new</span> <span class="title class_">Date</span>();</span><br><span class="line">d.<span class="title function_">getTime</span>()        <span class="comment">// 返回 1404568027739</span></span><br><span class="line"></span><br><span class="line">————————————————</span><br><span class="line">参考链接：<span class="attr">https</span>:<span class="comment">//www.runoob.com/js/js-type-conversion.html</span></span><br></pre></td></tr></table></figure>

<h3 id="JavaScript-刷新当前页面"><a href="#JavaScript-刷新当前页面" class="headerlink" title="JavaScript 刷新当前页面"></a>JavaScript 刷新当前页面</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">location.<span class="title function_">reload</span>();</span><br><span class="line"></span><br><span class="line"><span class="variable language_">window</span>.<span class="property">location</span>.<span class="title function_">replace</span>(<span class="string">&quot;https://nobige.cn&quot;</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment">//页面自动刷新：把如下代码加入&lt;head&gt;区域中,content为要等待刷新的秒数</span></span><br><span class="line">&lt;meta http-equiv=<span class="string">&quot;refresh&quot;</span> content=<span class="string">&quot;5&quot;</span>&gt;</span><br><span class="line">————————————————</span><br><span class="line">参考链接：<span class="attr">https</span>:<span class="comment">//www.runoob.com/w3cnote/js-refresh-current-page.html</span></span><br></pre></td></tr></table></figure>

<h3 id="JavaScript获取时间戳与时间戳转化"><a href="#JavaScript获取时间戳与时间戳转化" class="headerlink" title="JavaScript获取时间戳与时间戳转化"></a>JavaScript获取时间戳与时间戳转化</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line"><span class="title class_">Javascript</span> 获取当前时间戳（毫秒级别）：</span><br><span class="line">第一种方法：</span><br><span class="line"><span class="keyword">var</span> timestamp1 = <span class="title class_">Date</span>.<span class="title function_">parse</span>( <span class="keyword">new</span> <span class="title class_">Date</span>());</span><br><span class="line">结果：<span class="number">1470220594000</span></span><br><span class="line"></span><br><span class="line">第二种方法：</span><br><span class="line"><span class="keyword">var</span> timestamp2 = ( <span class="keyword">new</span> <span class="title class_">Date</span>()).<span class="title function_">valueOf</span>();</span><br><span class="line">结果：<span class="number">1470220608533</span></span><br><span class="line"></span><br><span class="line">第三种方法：</span><br><span class="line"><span class="keyword">var</span> timestamp3 = <span class="keyword">new</span> <span class="title class_">Date</span>().<span class="title function_">getTime</span>();</span><br><span class="line">结果：<span class="number">1470220608533</span></span><br><span class="line">第一种获取的时间戳是精确到秒，第二种和第三种是获取的时间戳精确到毫秒。</span><br><span class="line">获取指定时间的时间戳：</span><br><span class="line"><span class="keyword">new</span> <span class="title class_">Date</span>(<span class="string">&quot;2016-08-03 00:00:00&quot;</span>);</span><br><span class="line"></span><br><span class="line">时间戳转化成时间：</span><br><span class="line"><span class="keyword">function</span> <span class="title function_">timetrans</span>(<span class="params">date</span>)&#123;</span><br><span class="line"> <span class="keyword">var</span> date = <span class="keyword">new</span> <span class="title class_">Date</span>(date*<span class="number">1000</span>);<span class="comment">//如果date为13位不需要乘1000</span></span><br><span class="line"> <span class="keyword">var</span> Y = date.<span class="title function_">getFullYear</span>() + <span class="string">&#x27;-&#x27;</span>;</span><br><span class="line"> <span class="keyword">var</span> M = (date.<span class="title function_">getMonth</span>()+<span class="number">1</span> &lt; <span class="number">10</span> ? <span class="string">&#x27;0&#x27;</span>+(date.<span class="title function_">getMonth</span>()+<span class="number">1</span>) : date.<span class="title function_">getMonth</span>()+<span class="number">1</span>) + <span class="string">&#x27;-&#x27;</span>;</span><br><span class="line"> <span class="keyword">var</span> D = (date.<span class="title function_">getDate</span>() &lt; <span class="number">10</span> ? <span class="string">&#x27;0&#x27;</span> + (date.<span class="title function_">getDate</span>()) : date.<span class="title function_">getDate</span>()) + <span class="string">&#x27; &#x27;</span>;</span><br><span class="line"> <span class="keyword">var</span> h = (date.<span class="title function_">getHours</span>() &lt; <span class="number">10</span> ? <span class="string">&#x27;0&#x27;</span> + date.<span class="title function_">getHours</span>() : date.<span class="title function_">getHours</span>()) + <span class="string">&#x27;:&#x27;</span>;</span><br><span class="line"> <span class="keyword">var</span> m = (date.<span class="title function_">getMinutes</span>() &lt;<span class="number">10</span> ? <span class="string">&#x27;0&#x27;</span> + date.<span class="title function_">getMinutes</span>() : date.<span class="title function_">getMinutes</span>()) + <span class="string">&#x27;:&#x27;</span>;</span><br><span class="line"> <span class="keyword">var</span> s = (date.<span class="title function_">getSeconds</span>() &lt;<span class="number">10</span> ? <span class="string">&#x27;0&#x27;</span> + date.<span class="title function_">getSeconds</span>() : date.<span class="title function_">getSeconds</span>());</span><br><span class="line"> <span class="keyword">return</span> Y+M+D+h+m+s;</span><br><span class="line">&#125;</span><br><span class="line">————————————————</span><br><span class="line">参考链接：<span class="attr">https</span>:<span class="comment">//segmentfault.com/a/1190000006160703</span></span><br></pre></td></tr></table></figure>

<h3 id="JS设置CSS样式的几种方式"><a href="#JS设置CSS样式的几种方式" class="headerlink" title="JS设置CSS样式的几种方式"></a>JS设置CSS样式的几种方式</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//1. 直接设置style的属性  某些情况用这个设置 !important值无效</span></span><br><span class="line">	如果属性有<span class="string">&#x27;-&#x27;</span>号，就写成驼峰的形式（如textAlign）  如果想保留 - 号，就中括号的形式  element.<span class="property">style</span>[<span class="string">&#x27;text-align&#x27;</span>] = <span class="string">&#x27;100px&#x27;</span>;</span><br><span class="line">element.<span class="property">style</span>.<span class="property">height</span> = <span class="string">&#x27;100px&#x27;</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">//2. 直接设置属性（只能用于某些属性，相关样式会自动识别）</span></span><br><span class="line">element.<span class="title function_">setAttribute</span>(<span class="string">&#x27;height&#x27;</span>, <span class="number">100</span>);</span><br><span class="line">element.<span class="title function_">setAttribute</span>(<span class="string">&#x27;height&#x27;</span>, <span class="string">&#x27;100px&#x27;</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">//3. 设置style的属性</span></span><br><span class="line">element.<span class="title function_">setAttribute</span>(<span class="string">&#x27;style&#x27;</span>, <span class="string">&#x27;height: 100px !important&#x27;</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">//4. 使用setProperty  如果要设置!important，推荐用这种方法设置第三个参数</span></span><br><span class="line">element.<span class="property">style</span>.<span class="title function_">setProperty</span>(<span class="string">&#x27;height&#x27;</span>, <span class="string">&#x27;300px&#x27;</span>, <span class="string">&#x27;important&#x27;</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">//5. 改变class   比如JQ的更改class相关方法</span></span><br><span class="line"><span class="comment">//	因JS获取不到css的伪元素，所以可以通过改变伪元素父级的class来动态更改伪元素的样式</span></span><br><span class="line">element.<span class="property">className</span> = <span class="string">&#x27;blue&#x27;</span>;</span><br><span class="line">element.<span class="property">className</span> += <span class="string">&#x27;blue fb&#x27;</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">//6. 设置cssText</span></span><br><span class="line">element.<span class="property">style</span>.<span class="property">cssText</span> = <span class="string">&#x27;height: 100px !important&#x27;</span>;</span><br><span class="line">————————————————</span><br><span class="line">参考链接：<span class="attr">https</span>:<span class="comment">//www.cnblogs.com/LiuWeiLong/p/6058059.html</span></span><br></pre></td></tr></table></figure>

<h3 id="骚操作"><a href="#骚操作" class="headerlink" title="骚操作"></a>骚操作</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">0</span>==<span class="literal">false</span></span><br><span class="line"><span class="number">1</span>==<span class="literal">true</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//	短路运算-使用||</span></span><br><span class="line"><span class="string">&#x27;nobige&#x27;</span> || <span class="number">0</span>	<span class="comment">//	&quot;nobige&quot;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//	短路运算-使用&amp;&amp;</span></span><br><span class="line"><span class="keyword">if</span> (isOnline) &#123;</span><br><span class="line">  <span class="title function_">postMessage</span>();</span><br><span class="line">&#125;</span><br><span class="line">isOnline &amp;&amp; <span class="title function_">postMessage</span>();</span><br><span class="line"></span><br><span class="line"><span class="comment">//	临时变量</span></span><br><span class="line"><span class="keyword">var</span> temp = a; a = b; b = temp;	<span class="comment">// 传统，但需要借助临时变量</span></span><br><span class="line">a ^= b; b ^= a; a ^= b; 	<span class="comment">// 需要两个整数</span></span><br><span class="line"><span class="keyword">void</span> <span class="number">0</span> == <span class="literal">undefined</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//	只有0为真</span></span><br><span class="line">!<span class="number">0</span>==<span class="literal">true</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 非零都是为假</span></span><br><span class="line">!<span class="number">1</span>==<span class="literal">false</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 字符查找判断</span></span><br><span class="line">~<span class="string">&#x27;nobige.cn&#x27;</span>.<span class="title function_">indexOf</span>(<span class="string">&#x27;com&#x27;</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment">// 浮点转整数,正负数均可.</span></span><br><span class="line"><span class="built_in">parseInt</span>(num)</span><br><span class="line"></span><br><span class="line"><span class="comment">// 使用情况要看数字是否会溢出，小数字建议使用</span></span><br><span class="line">~~num</span><br><span class="line">num &gt;&gt; <span class="number">0</span></span><br><span class="line">num &lt;&lt; <span class="number">0</span></span><br><span class="line">num | <span class="number">0</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//10位随机字符</span></span><br><span class="line"><span class="title class_">Math</span>.<span class="title function_">random</span>().<span class="title function_">toString</span>(<span class="number">16</span>).<span class="title function_">substr</span>(<span class="number">2</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment">//	随机颜色</span></span><br><span class="line"><span class="string">&#x27;#&#x27;</span>+<span class="title class_">Math</span>.<span class="title function_">random</span>().<span class="title function_">toString</span>(<span class="number">16</span>).<span class="title function_">substr</span>(<span class="number">2</span>, <span class="number">6</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment">//	美化 console</span></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">info</span>(<span class="string">&quot;%cNobige&quot;</span>, <span class="string">&quot;color: #181818; font-size: 30px; font-family: sans-serif&quot;</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">//	三木运算</span></span><br><span class="line"><span class="keyword">var</span> a = x &gt; <span class="number">0</span> ? !<span class="number">0</span> : !<span class="number">1</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//	字符串转数字</span></span><br><span class="line">n = +<span class="string">&#x27;18&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//	数字转字符串</span></span><br><span class="line">n = <span class="number">18</span>+<span class="string">&#x27;&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//	数组截取</span></span><br><span class="line"><span class="keyword">var</span> array = [<span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>];</span><br><span class="line">array.<span class="property">length</span> = <span class="number">3</span>;</span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(array);	<span class="comment">// [0, 1, 2]</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//	批量变量赋值</span></span><br><span class="line"><span class="keyword">var</span> a = <span class="number">1</span>, b = a, c = b;</span><br><span class="line"></span><br><span class="line"><span class="comment">//	闭包</span></span><br><span class="line">!(<span class="keyword">function</span>(<span class="params"></span>)&#123;</span><br><span class="line">    <span class="comment">//code...</span></span><br><span class="line">&#125;)();</span><br><span class="line"></span><br><span class="line"><span class="comment">// 滚动条控制</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">documentElement</span>.<span class="property">scrollTop</span></span><br></pre></td></tr></table></figure>

<h3 id="奇偶数判断"><a href="#奇偶数判断" class="headerlink" title="奇偶数判断"></a>奇偶数判断</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 普通写法,多采用取模(%)的方法</span></span><br><span class="line"><span class="number">2</span> % <span class="number">2</span> = <span class="number">0</span> <span class="comment">// 偶数</span></span><br><span class="line"><span class="number">3</span> % <span class="number">2</span> = <span class="number">1</span> <span class="comment">// 奇数</span></span><br><span class="line">num % <span class="number">2</span> === <span class="number">0</span> ? <span class="string">&#x27;偶数&#x27;</span> : <span class="string">&#x27;奇数&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">* &amp; 运算符的写法</span></span><br><span class="line"><span class="comment">* &amp;以特定的方式组合操作二进制数中对应的位</span></span><br><span class="line"><span class="comment">* 如果对应的位都为1，那么结果就是1</span></span><br><span class="line"><span class="comment">* 如果任意一个位是0 则结果就是0</span></span><br><span class="line"><span class="comment">* </span></span><br><span class="line"><span class="comment">* */</span></span><br><span class="line"><span class="comment">// 1的二进制表示为: 00000000 00000000 00000000 00000001</span></span><br><span class="line"><span class="comment">// 3的二进制表示为: 00000000 00000000 00000000 00000011</span></span><br><span class="line"><span class="number">2</span> &amp; <span class="number">1</span> = <span class="number">0</span></span><br><span class="line"><span class="number">3</span> &amp; <span class="number">1</span> = <span class="number">1</span></span><br><span class="line">num &amp; <span class="number">1</span> === <span class="number">0</span> ? <span class="string">&#x27;偶数&#x27;</span> : <span class="string">&#x27;奇数&#x27;</span></span><br><span class="line">————————————————</span><br><span class="line">日期:<span class="number">2020</span>/<span class="number">10</span>/<span class="number">22</span></span><br><span class="line">参考链接：<span class="attr">https</span>:<span class="comment">//my.oschina.net/u/3419683/blog/4354654</span></span><br></pre></td></tr></table></figure>

<h3 id="判断是否为空Null"><a href="#判断是否为空Null" class="headerlink" title="判断是否为空Null"></a>判断是否为空Null</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> a=<span class="string">&#x27;&#x27;</span></span><br><span class="line"><span class="keyword">if</span>([<span class="literal">null</span>, <span class="literal">undefined</span>, <span class="string">&#x27;&#x27;</span>].<span class="title function_">includes</span>(a))&#123;</span><br><span class="line">	<span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="string">&#x27;is null&#x27;</span>)</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">if</span>(~[<span class="literal">null</span>, <span class="literal">undefined</span>, <span class="string">&#x27;&#x27;</span>].<span class="title function_">indexOf</span>(a))&#123;</span><br><span class="line">	<span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="string">&#x27;is null&#x27;</span>)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h3 id="时间戳转日期"><a href="#时间戳转日期" class="headerlink" title="时间戳转日期"></a>时间戳转日期</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// &quot;2020-10-26 15:23:45&quot;</span></span><br><span class="line"><span class="keyword">function</span> <span class="title function_">time</span>(<span class="params">time = +<span class="keyword">new</span> <span class="built_in">Date</span>()</span>) &#123;</span><br><span class="line">    <span class="keyword">var</span> date = <span class="keyword">new</span> <span class="title class_">Date</span>(time + <span class="number">8</span> * <span class="number">3600</span> * <span class="number">1000</span>); <span class="comment">// 增加8小时</span></span><br><span class="line">    <span class="keyword">return</span> date.<span class="title function_">toJSON</span>().<span class="title function_">substr</span>(<span class="number">0</span>, <span class="number">19</span>).<span class="title function_">replace</span>(<span class="string">&#x27;T&#x27;</span>, <span class="string">&#x27; &#x27;</span>);</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">// &quot;2020.10.26 15:23:45&quot;</span></span><br><span class="line"><span class="keyword">function</span> <span class="title function_">time</span>(<span class="params">time = +<span class="keyword">new</span> <span class="built_in">Date</span>()</span>) &#123;</span><br><span class="line">    <span class="keyword">var</span> date = <span class="keyword">new</span> <span class="title class_">Date</span>(time + <span class="number">8</span> * <span class="number">3600</span> * <span class="number">1000</span>);</span><br><span class="line">    <span class="keyword">return</span> date.<span class="title function_">toJSON</span>().<span class="title function_">substr</span>(<span class="number">0</span>, <span class="number">19</span>).<span class="title function_">replace</span>(<span class="string">&#x27;T&#x27;</span>, <span class="string">&#x27; &#x27;</span>).<span class="title function_">replace</span>(<span class="regexp">/-/g</span>, <span class="string">&#x27;.&#x27;</span>);</span><br><span class="line">&#125;</span><br><span class="line">————————————————</span><br><span class="line">日期:<span class="number">2020</span>/<span class="number">10</span>/<span class="number">26</span></span><br><span class="line">参考链接：<span class="attr">https</span>:<span class="comment">//segmentfault.com/a/1190000015992232</span></span><br><span class="line">————————————————</span><br><span class="line">日期:<span class="number">2020</span>-<span class="number">10</span>-<span class="number">26</span></span><br><span class="line">参考链接：<span class="attr">https</span>:<span class="comment">//www.cnblogs.com/CyLee/p/5992673.html</span></span><br></pre></td></tr></table></figure>

<h3 id="javascript书签"><a href="#javascript书签" class="headerlink" title="javascript书签"></a>javascript书签</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">javascript</span>:(</span><br><span class="line">	<span class="comment">//code...</span></span><br><span class="line">)();</span><br><span class="line"></span><br><span class="line"><span class="comment">// 例如</span></span><br><span class="line"><span class="attr">javascript</span>:(<span class="keyword">function</span> (<span class="params"></span>) &#123;</span><br><span class="line"><span class="keyword">var</span> txt = <span class="string">&quot;————————————————\n日期:&quot;</span>+<span class="keyword">new</span> <span class="title class_">Date</span>().<span class="title function_">toISOString</span>().<span class="title function_">substr</span>(<span class="number">0</span>,<span class="number">10</span>)+<span class="string">&quot;\n参考链接：&quot;</span>+<span class="variable language_">window</span>.<span class="property">location</span>.<span class="property">href</span>;<span class="title function_">prompt</span>(<span class="string">&#x27;参考&#x27;</span>,txt)</span><br><span class="line">&#125;)();</span><br><span class="line"></span><br><span class="line"><span class="comment">// https://favor.fund.eastmoney.com/ QDII 参考</span></span><br><span class="line"><span class="attr">javascript</span>:(<span class="keyword">function</span> (<span class="params"></span>) &#123;</span><br><span class="line"><span class="keyword">var</span> a=<span class="number">0</span>,aN=<span class="number">0</span>;</span><br><span class="line">jQuery.<span class="title function_">each</span>(<span class="title function_">jQuery</span>(<span class="string">&quot;#position_shares &gt; div.poptableWrap &gt; table&quot;</span>).<span class="title function_">find</span>(<span class="string">&#x27;tr&#x27;</span>), <span class="keyword">function</span>(<span class="params">index, val</span>) &#123;</span><br><span class="line">    <span class="keyword">var</span> x = <span class="title function_">jQuery</span>(<span class="variable language_">this</span>).<span class="title function_">find</span>(<span class="string">&#x27;td:nth-child(2)&#x27;</span>).<span class="title function_">text</span>(),</span><br><span class="line">    y = <span class="title function_">jQuery</span>(<span class="variable language_">this</span>).<span class="title function_">find</span>(<span class="string">&#x27;td:nth-child(3)&#x27;</span>).<span class="title function_">text</span>(),</span><br><span class="line">    xAll = <span class="title function_">jQuery</span>(<span class="string">&quot;#position_shares &gt; div.poptableWrap &gt; p &gt; span.sum-num&quot;</span>).<span class="title function_">text</span>();</span><br><span class="line">    y = y.<span class="title function_">replace</span>(<span class="string">&#x27;%&#x27;</span>,<span class="string">&#x27;&#x27;</span>);</span><br><span class="line">    xAll = xAll.<span class="title function_">replace</span>(<span class="string">&#x27;%&#x27;</span>,<span class="string">&#x27;&#x27;</span>)/<span class="number">100</span>;</span><br><span class="line">    aN = y&gt;<span class="number">0</span>?aN+<span class="number">1</span>:aN;</span><br><span class="line">    a+=x.<span class="title function_">replace</span>(<span class="string">&#x27;%&#x27;</span>,<span class="string">&#x27;&#x27;</span>)/<span class="number">10</span>*y*xAll;</span><br><span class="line">&#125;);</span><br><span class="line"><span class="title function_">alert</span>(<span class="string">&#x27;预计涨幅：&#x27;</span>+a+<span class="string">&#x27;\n涨的个数：&#x27;</span>+aN);</span><br><span class="line">&#125;)();</span><br></pre></td></tr></table></figure>

<h3 id="html拼接"><a href="#html拼接" class="headerlink" title="html拼接"></a>html拼接</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 用引号</span></span><br><span class="line"><span class="string">``</span></span><br><span class="line"><span class="comment">// 变量用 $&#123;&#125;</span></span><br><span class="line"><span class="keyword">var</span> txt = <span class="string">`</span></span><br><span class="line"><span class="string">    ————————————————</span></span><br><span class="line"><span class="string">    日期:<span class="subst">$&#123;<span class="keyword">new</span> <span class="built_in">Date</span>().toISOString().substr(<span class="number">0</span>,<span class="number">10</span>)&#125;</span></span></span><br><span class="line"><span class="string">    参考链接：<span class="subst">$&#123;<span class="variable language_">window</span>.location.href&#125;</span></span></span><br><span class="line"><span class="string">    `</span></span><br><span class="line"><span class="comment">// 原样输出，换行+制表符</span></span><br></pre></td></tr></table></figure>

<h3 id="关键词"><a href="#关键词" class="headerlink" title="关键词"></a>关键词</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 字符分割</span></span><br><span class="line"><span class="title class_">String</span>(<span class="string">&#x27;nobige.cn&#x27;</span>).<span class="title function_">split</span>(<span class="string">&#x27;.&#x27;</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment">// 跳出当前循环</span></span><br><span class="line"><span class="keyword">continue</span></span><br></pre></td></tr></table></figure>

<h3 id="禁止Debug"><a href="#禁止Debug" class="headerlink" title="禁止Debug"></a>禁止Debug</h3><blockquote>
<p>让JS控制台永远Debuger状态，禁止F12控制台调试JavaScript</p>
<p>加密前手动添加各个位置效果会更好,最好配合无限循环</p>
</blockquote>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 禁用JavaScript调试代码</span></span><br><span class="line">(<span class="keyword">function</span> (<span class="params">a</span>) &#123;</span><br><span class="line">    <span class="keyword">return</span> (<span class="keyword">function</span> (<span class="params">a</span>) &#123;</span><br><span class="line">        <span class="keyword">return</span> (<span class="title class_">Function</span>(<span class="string">&#x27;Function(arguments[0]+&quot;&#x27;</span> + a + <span class="string">&#x27;&quot;)()&#x27;</span>))</span><br><span class="line">    &#125;)(a)</span><br><span class="line">&#125;)(<span class="string">&#x27;bugger&#x27;</span>)(<span class="string">&#x27;de&#x27;</span>, <span class="number">0</span>, <span class="number">0</span>, (<span class="number">0</span>, <span class="number">0</span>));</span><br><span class="line"><span class="comment">//  ————————————————</span></span><br><span class="line"><span class="comment">//  日期:2022-01-18</span></span><br><span class="line"><span class="comment">//  参考链接：https://blog.oioweb.cn/28.html</span></span><br></pre></td></tr></table></figure>

<h3 id="获取URL参数"><a href="#获取URL参数" class="headerlink" title="获取URL参数"></a>获取URL参数</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment">* 获取get参数</span></span><br><span class="line"><span class="comment">**/</span></span><br><span class="line"><span class="keyword">var</span> getUrlParam = <span class="keyword">function</span> (<span class="params">name</span>)&#123;</span><br><span class="line">    <span class="comment">// 获取参数</span></span><br><span class="line">    <span class="keyword">var</span> url = <span class="variable language_">window</span>.<span class="property">location</span>.<span class="property">search</span>;</span><br><span class="line">    <span class="comment">// 正则筛选地址栏</span></span><br><span class="line">    <span class="keyword">var</span> reg = <span class="keyword">new</span> <span class="title class_">RegExp</span>(<span class="string">&quot;(^|&amp;)&quot;</span>+ name +<span class="string">&quot;=([^&amp;]*)(&amp;|$)&quot;</span>);</span><br><span class="line">    <span class="comment">// 匹配目标参数</span></span><br><span class="line">    <span class="keyword">var</span> result = url.<span class="title function_">substr</span>(<span class="number">1</span>).<span class="title function_">match</span>(reg);</span><br><span class="line">    <span class="comment">//返回参数值</span></span><br><span class="line">    <span class="keyword">return</span> result ? <span class="built_in">decodeURIComponent</span>(result[<span class="number">2</span>]) : <span class="literal">null</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="数组转URL参数"><a href="#数组转URL参数" class="headerlink" title="数组转URL参数"></a>数组转URL参数</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment">* 数组转URL</span></span><br><span class="line"><span class="comment">* */</span></span><br><span class="line"><span class="keyword">var</span> arr2url = <span class="keyword">function</span> (<span class="params">x</span>) &#123;</span><br><span class="line">    <span class="keyword">var</span> y = [];</span><br><span class="line">    <span class="title class_">Object</span>.<span class="title function_">entries</span>(x).<span class="title function_">forEach</span>(<span class="function">(<span class="params">[a, b]</span>) =&gt;</span> &#123;</span><br><span class="line">    y.<span class="title function_">push</span>(a + <span class="string">&#x27;=&#x27;</span> + b);</span><br><span class="line">    &#125;);</span><br><span class="line">    <span class="keyword">return</span> <span class="string">&#x27;?&#x27;</span> + y.<span class="title function_">join</span>(<span class="string">&#x27;&amp;&#x27;</span>);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="Arguments-对象"><a href="#Arguments-对象" class="headerlink" title="Arguments 对象"></a>Arguments 对象</h3><blockquote>
<p><strong>arguments</strong> 是一个对应于传递给函数的参数的类数组对象。</p>
<p>IE 3+</p>
<p><a target="_blank" rel="noopener" href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Functions/arguments">https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Functions/arguments</a></p>
</blockquote>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">function</span> <span class="title function_">func1</span>(<span class="params">a,b</span>) &#123;</span><br><span class="line">  <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="variable language_">arguments</span>[<span class="number">0</span>]);</span><br><span class="line">  <span class="comment">// expected output: 1</span></span><br><span class="line"></span><br><span class="line">  <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="variable language_">arguments</span>[<span class="number">1</span>]);</span><br><span class="line">  <span class="comment">// expected output: 2</span></span><br><span class="line"></span><br><span class="line">  <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="variable language_">arguments</span>[<span class="number">2</span>]);</span><br><span class="line">  <span class="comment">// expected output: 3</span></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="title function_">func1</span>(<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>);</span><br><span class="line">&gt; <span class="number">1</span></span><br><span class="line">&gt; <span class="number">2</span></span><br><span class="line">&gt; <span class="number">3</span></span><br></pre></td></tr></table></figure>

<h3 id="Object-keys"><a href="#Object-keys" class="headerlink" title="Object.keys()"></a>Object.keys()</h3><blockquote>
<p><code>Object.keys()</code> 方法会返回一个由一个给定对象的自身可枚举属性组成的数组，数组中属性名的排列顺序和正常循环遍历该对象时返回的顺序一致。</p>
<p>IE 9+</p>
<p><a target="_blank" rel="noopener" href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/keys">https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/keys</a></p>
</blockquote>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// simple array</span></span><br><span class="line"><span class="keyword">var</span> arr = [<span class="string">&#x27;a&#x27;</span>, <span class="string">&#x27;b&#x27;</span>, <span class="string">&#x27;c&#x27;</span>];</span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="title class_">Object</span>.<span class="title function_">keys</span>(arr)); <span class="comment">// console: [&#x27;0&#x27;, &#x27;1&#x27;, &#x27;2&#x27;]</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// array like object</span></span><br><span class="line"><span class="keyword">var</span> obj = &#123; <span class="number">0</span>: <span class="string">&#x27;a&#x27;</span>, <span class="number">1</span>: <span class="string">&#x27;b&#x27;</span>, <span class="number">2</span>: <span class="string">&#x27;c&#x27;</span> &#125;;</span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="title class_">Object</span>.<span class="title function_">keys</span>(obj)); <span class="comment">// console: [&#x27;0&#x27;, &#x27;1&#x27;, &#x27;2&#x27;]</span></span><br></pre></td></tr></table></figure>

<h3 id="Object-prototype-hasOwnProperty"><a href="#Object-prototype-hasOwnProperty" class="headerlink" title="Object.prototype.hasOwnProperty()"></a>Object.prototype.hasOwnProperty()</h3><blockquote>
<p><code>hasOwnProperty()</code> 方法会返回一个布尔值，指示对象自身属性中是否具有指定的属性（也就是，是否有指定的键)</p>
<p>IE 5.5+</p>
<p><a target="_blank" rel="noopener" href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty">https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty</a></p>
</blockquote>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> object1 = &#123;&#125;;</span><br><span class="line">object1.<span class="property">property1</span> = <span class="number">42</span>;</span><br><span class="line"></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(object1.<span class="title function_">hasOwnProperty</span>(<span class="string">&#x27;property1&#x27;</span>));</span><br><span class="line"><span class="comment">// expected output: true</span></span><br><span class="line"></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(object1.<span class="title function_">hasOwnProperty</span>(<span class="string">&#x27;toString&#x27;</span>));</span><br><span class="line"><span class="comment">// expected output: false</span></span><br><span class="line"></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(object1.<span class="title function_">hasOwnProperty</span>(<span class="string">&#x27;hasOwnProperty&#x27;</span>));</span><br><span class="line"><span class="comment">// expected output: false</span></span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h3 id="Array-prototype-map"><a href="#Array-prototype-map" class="headerlink" title="Array.prototype.map()"></a>Array.prototype.map()</h3><blockquote>
<p><code>map()</code> 方法创建一个新数组，这个新数组由原数组中的每个元素都调用一次提供的函数后的返回值组成</p>
<p>IE 9+</p>
<p><a target="_blank" rel="noopener" href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/map">https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/map</a></p>
</blockquote>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> array1 = [<span class="number">1</span>, <span class="number">4</span>, <span class="number">9</span>, <span class="number">16</span>];</span><br><span class="line"></span><br><span class="line"><span class="comment">// pass a function to map</span></span><br><span class="line"><span class="keyword">const</span> map1 = array1.<span class="title function_">map</span>(<span class="function"><span class="params">x</span> =&gt;</span> x * <span class="number">2</span>);</span><br><span class="line"></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(map1);</span><br><span class="line"><span class="comment">// expected output: Array [2, 8, 18, 32]</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 跳出当前循环</span></span><br><span class="line"><span class="keyword">return</span> </span><br><span class="line"><span class="comment">// 跳出循环，无</span></span><br></pre></td></tr></table></figure>

<h3 id="Array-prototype-filter"><a href="#Array-prototype-filter" class="headerlink" title="Array.prototype.filter()"></a>Array.prototype.filter()</h3><blockquote>
<p><code>filter()</code> 方法创建一个新数组，其包含通过所提供函数实现的测试的所有元素。</p>
<p>IE 9+</p>
<p><a target="_blank" rel="noopener" href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/filter">https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/filter</a></p>
</blockquote>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> words = [<span class="string">&#x27;spray&#x27;</span>, <span class="string">&#x27;limit&#x27;</span>, <span class="string">&#x27;elite&#x27;</span>, <span class="string">&#x27;exuberant&#x27;</span>, <span class="string">&#x27;destruction&#x27;</span>, <span class="string">&#x27;present&#x27;</span>];</span><br><span class="line"></span><br><span class="line"><span class="keyword">const</span> result = words.<span class="title function_">filter</span>(<span class="function"><span class="params">word</span> =&gt;</span> word.<span class="property">length</span> &gt; <span class="number">6</span>);</span><br><span class="line"></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(result);</span><br><span class="line"><span class="comment">// expected output: Array [&quot;exuberant&quot;, &quot;destruction&quot;, &quot;present&quot;]</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 跳出当前循环</span></span><br><span class="line"><span class="keyword">return</span> </span><br><span class="line"><span class="comment">// 跳出循环，无</span></span><br></pre></td></tr></table></figure>

<h3 id="for…in"><a href="#for…in" class="headerlink" title="for…in"></a>for…in</h3><blockquote>
<p><code>for...in</code>语句以任意顺序迭代一个对象的除Symbol以外的可枚举属性，包括继承的可枚举属性。</p>
<p>IE 3+</p>
<p><a target="_blank" rel="noopener" href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/for...in#%E6%B5%8F%E8%A7%88%E5%99%A8%E5%85%BC%E5%AE%B9">https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/for...in#%E6%B5%8F%E8%A7%88%E5%99%A8%E5%85%BC%E5%AE%B9</a></p>
</blockquote>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> obj = &#123;<span class="attr">a</span>:<span class="number">1</span>, <span class="attr">b</span>:<span class="number">2</span>, <span class="attr">c</span>:<span class="number">3</span>&#125;;</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">var</span> prop <span class="keyword">in</span> obj) &#123;</span><br><span class="line">  <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="string">&quot;obj.&quot;</span> + prop + <span class="string">&quot; = &quot;</span> + obj[prop]);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// Output:</span></span><br><span class="line"><span class="comment">// &quot;obj.a = 1&quot;</span></span><br><span class="line"><span class="comment">// &quot;obj.b = 2&quot;</span></span><br><span class="line"><span class="comment">// &quot;obj.c = 3&quot;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 兼容性：初始化函数表达式,使用一个初始化表达式（i=0）在一个for...in循环中：</span></span><br><span class="line"><span class="keyword">var</span> obj = &#123;<span class="attr">a</span>: <span class="number">1</span>, <span class="attr">b</span>: <span class="number">2</span>, <span class="attr">c</span>: <span class="number">3</span>&#125;;</span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span> <span class="keyword">in</span> obj) &#123;</span><br><span class="line">  <span class="variable language_">console</span>.<span class="title function_">log</span>(obj[i]);</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">// 1</span></span><br><span class="line"><span class="comment">// 2</span></span><br><span class="line"><span class="comment">// 3</span></span><br></pre></td></tr></table></figure>



<h3 id="方法"><a href="#方法" class="headerlink" title="方法"></a>方法</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 语言元素 描述 </span></span><br><span class="line">abs <span class="comment">// 方法 返回一个数的绝对值。</span></span><br><span class="line">  </span><br><span class="line">acos <span class="comment">// 方法 返回一个数的反余弦。</span></span><br><span class="line">  </span><br><span class="line">anchor <span class="comment">// 方法 在对象的指定文本两端加上一个带 NAME 属性的 HTML 锚点。</span></span><br><span class="line"> </span><br><span class="line">apply <span class="comment">// 方法 应用对象的一个// 方法，用当前对象代替另一对象。</span></span><br><span class="line"> </span><br><span class="line">asin <span class="comment">// 方法 返回一个数的反正弦。</span></span><br><span class="line">  </span><br><span class="line">atan <span class="comment">// 方法 返回一个数的反正切。</span></span><br><span class="line">  </span><br><span class="line">atan2 <span class="comment">// 方法 返回从 X 轴到点 （y, x）的角度（以弧度为单位）。</span></span><br><span class="line"> </span><br><span class="line">atEnd <span class="comment">// 方法 返回一个表明枚举算子是否处于集合结束处的 Boolean 值。</span></span><br><span class="line"> </span><br><span class="line">big <span class="comment">// 方法 在String 对象的文本两端加入 HTML 的&lt;BIG&gt;标识。</span></span><br><span class="line"> </span><br><span class="line">blink <span class="comment">// 方法 将 HTML 的 &lt;BLINK&gt; 标识添加到 String 对象中的文本两端。</span></span><br><span class="line"> </span><br><span class="line">bold <span class="comment">// 方法 将 HTML 的 &lt;B&gt; 标识添加到String 对象中的文本两端。</span></span><br><span class="line"> </span><br><span class="line">call <span class="comment">// 方法 应用对象的一个// 方法，用当前对象代替另一对象。</span></span><br><span class="line"> </span><br><span class="line">ceil <span class="comment">// 方法 返回大于或等于其数值参数的最小整数。</span></span><br><span class="line">  </span><br><span class="line">charAt <span class="comment">// 方法 返回位于指定索引位置的字符。</span></span><br><span class="line"> </span><br><span class="line">charCodeAt <span class="comment">// 方法 返回指定字符的 Unicode 编码。</span></span><br><span class="line"> </span><br><span class="line">compile <span class="comment">// 方法 将一个正则表达式编译为内部格式。</span></span><br><span class="line"> </span><br><span class="line">concat <span class="comment">// 方法（Array） 返回一个由两个数组合并组成的新数组。</span></span><br><span class="line"> </span><br><span class="line">concat <span class="comment">// 方法（String） 返回一个包含给定的两个字符串的连接的 String 对象。</span></span><br><span class="line"> </span><br><span class="line">cos <span class="comment">// 方法 返回一个数的余弦。</span></span><br><span class="line">  </span><br><span class="line"><span class="built_in">decodeURI</span> <span class="comment">// 方法 返回一个已编码的通用资源标识符 (URI) 的解码版。</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">decodeURIComponent</span> <span class="comment">// 方法 返回一个已编码的通用资源标识符 (URI) 的解码版。</span></span><br><span class="line"> </span><br><span class="line">dimensions <span class="comment">// 方法 返回 VBArray 的维数。</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">escape</span> <span class="comment">// 方法 对 String 对象编码，以便在所有计算机上都能阅读。</span></span><br><span class="line">  </span><br><span class="line"><span class="built_in">eval</span> <span class="comment">// 方法 对 JScript 代码求值然后执行之。</span></span><br><span class="line"> </span><br><span class="line">exec <span class="comment">// 方法 在指定字符串中执行一个匹配查找。</span></span><br><span class="line"> </span><br><span class="line">exp <span class="comment">// 方法 返回 e （自然对数的底） 的幂。</span></span><br><span class="line">  </span><br><span class="line">fixed <span class="comment">// 方法 将 HTML 的&lt;TT&gt; 标识添加到String 对象中的文本两端。</span></span><br><span class="line">  </span><br><span class="line">floor <span class="comment">// 方法 返回小于或等于其数值参数的最大整数。</span></span><br><span class="line">  </span><br><span class="line">fontcolor <span class="comment">// 方法 将 HTML 带 COLOR 属性的&lt;FONT&gt;标识添加到 String 对象中的文本两端。</span></span><br><span class="line"> </span><br><span class="line">fontsize <span class="comment">// 方法 将 HTML 带 SIZE 属性的&lt;FONT&gt;标识添加到 String 对象中的文本两端。</span></span><br><span class="line"> </span><br><span class="line">fromCharCode <span class="comment">// 方法 返回 Unicode 字符值的字符串。</span></span><br><span class="line"> </span><br><span class="line">getDate <span class="comment">// 方法 使用当地时间返回 Date 对象的月份日期值。</span></span><br><span class="line"> </span><br><span class="line">getDay <span class="comment">// 方法 使用当地时间返回 Date 对象的星期几。</span></span><br><span class="line"> </span><br><span class="line">getFullYear <span class="comment">// 方法 使用当地时间返回 Date 对象的年份。</span></span><br><span class="line"> </span><br><span class="line">getHours <span class="comment">// 方法 使用当地时间返回 Date 对象的小时值。</span></span><br><span class="line"> </span><br><span class="line">getItem <span class="comment">// 方法 返回位于指定位置的项。</span></span><br><span class="line"> </span><br><span class="line">getMilliseconds <span class="comment">// 方法 使用当地时间返回 Date 对象的毫秒值。</span></span><br><span class="line"> </span><br><span class="line">getMinutes <span class="comment">// 方法 使用当地时间返回 Date 对象的分钟值。</span></span><br><span class="line"> </span><br><span class="line">getMonth <span class="comment">// 方法 使用当地时间返回 Date 对象的月份。</span></span><br><span class="line"> </span><br><span class="line">getSeconds <span class="comment">// 方法 使用当地时间返回 Date 对象的秒数。</span></span><br><span class="line"> </span><br><span class="line">getTime <span class="comment">// 方法 返回 Date 对象中的时间。</span></span><br><span class="line"> </span><br><span class="line">getTimezoneOffset <span class="comment">// 方法 返回主机的时间和全球标准时间（UTC）之间的差（以分钟为单位）。</span></span><br><span class="line"> </span><br><span class="line">getUTCDate <span class="comment">// 方法 使用全球标准时间（UTC）返回 Date 对象的日期值。</span></span><br><span class="line"> </span><br><span class="line">getUTCDay <span class="comment">// 方法 使用全球标准时间（UTC）返回 Date 对象的星期几。</span></span><br><span class="line"> </span><br><span class="line">getUTCFullYear <span class="comment">// 方法 使用全球标准时间（UTC）返回 Date 对象的年份。</span></span><br><span class="line"> </span><br><span class="line">getUTCHours <span class="comment">// 方法 使用全球标准时间（UTC）返回Date 对象的小时数。</span></span><br><span class="line"> </span><br><span class="line">getUTCMilliseconds <span class="comment">// 方法 使用全球标准时间（UTC）返回Date 对象的毫秒数。</span></span><br><span class="line"> </span><br><span class="line">getUTCMinutes <span class="comment">// 方法 使用全球标准时间（UTC）返回 Date 对象的分钟数。</span></span><br><span class="line"> </span><br><span class="line">getUTCMonth <span class="comment">// 方法 使用全球标准时间（UTC）返回 Date 对象的月份值。</span></span><br><span class="line"> </span><br><span class="line">getUTCSeconds <span class="comment">// 方法 使用全球标准时间（UTC）返回Date对象的秒数。</span></span><br><span class="line"> </span><br><span class="line">getVarDate <span class="comment">// 方法 返回 Date 对象中的 VT_DATE。</span></span><br><span class="line"> </span><br><span class="line">getYear <span class="comment">// 方法 返回 Date 对象中的年份。</span></span><br><span class="line"> </span><br><span class="line">hasOwnProperty <span class="comment">// 方法 返回一个 Boolean 值，表明对象是否具有指定的名称。</span></span><br><span class="line"> </span><br><span class="line">indexOf <span class="comment">// 方法 返回在 String 对象中第一次出现子字符串的字符位置。</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">isFinite</span> <span class="comment">// 方法 返回一个 Boolean 值，表明某个给定的数是否是有穷的。</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">isNaN</span> <span class="comment">// 方法 返回一个 Boolean 值，表明某个值是否为保留值 NaN （不是一个数）。</span></span><br><span class="line"> </span><br><span class="line">isPrototypeOf <span class="comment">// 方法 返回一个 Boolean 值，表明对象是否存在于另一对象的原型链中。</span></span><br><span class="line"> </span><br><span class="line">italics <span class="comment">// 方法 将 HTML的 &lt;I&gt; 标识添加到 String 对象中的文本两端。</span></span><br><span class="line"> </span><br><span class="line">item <span class="comment">// 方法 返回集合中的当前项。</span></span><br><span class="line"> </span><br><span class="line">join <span class="comment">// 方法 返回一个由数组中的所有元素连接在一起的 String 对象。</span></span><br><span class="line"> </span><br><span class="line">lastIndexOf <span class="comment">// 方法 返回在 String 对象中子字符串最后出现的位置。</span></span><br><span class="line"> </span><br><span class="line">lbound <span class="comment">// 方法 返回在 VBArray 中指定维数所用的最小索引值。</span></span><br><span class="line"> </span><br><span class="line">link <span class="comment">// 方法 将带 HREF 属性的 HTML 锚点添加到 String 对象中的文本两端。</span></span><br><span class="line"> </span><br><span class="line">localeCompare <span class="comment">// 方法 返回一个值，表明两个字符串在当前区域设置下是否相等。</span></span><br><span class="line"> </span><br><span class="line">log <span class="comment">// 方法 返回某个数的自然对数。</span></span><br><span class="line"> </span><br><span class="line">match <span class="comment">// 方法 使用给定的正则表达式对象对字符串进行查找，并将结果作为数组返回。</span></span><br><span class="line"> </span><br><span class="line">max <span class="comment">// 方法 返回给定的两个表达式中的较大者。</span></span><br><span class="line"> </span><br><span class="line">min <span class="comment">// 方法 返回给定的两个数中的较小者。</span></span><br><span class="line"> </span><br><span class="line">moveFirst <span class="comment">// 方法 将集合中的当前项设置为第一项。</span></span><br><span class="line"> </span><br><span class="line">moveNext <span class="comment">// 方法 将当前项设置为集合中的下一项。</span></span><br><span class="line"> </span><br><span class="line">parse <span class="comment">// 方法 对包含日期的字符串进行分析，并返回该日期与1970年1月1日零点之间相差的毫秒数。</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">parseFloat</span> <span class="comment">// 方法 返回从字符串转换而来的浮点数。</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">parseInt</span> <span class="comment">// 方法 返回从字符串转换而来的整数。</span></span><br><span class="line"> </span><br><span class="line">pop <span class="comment">// 方法 删除数组中的最后一个元素并返回该值。</span></span><br><span class="line"> </span><br><span class="line">pow <span class="comment">// 方法 返回一个指定幂次的底表达式的值。</span></span><br><span class="line">  </span><br><span class="line">push <span class="comment">// 方法 向数组中添加新元素，返回数组的新长度。</span></span><br><span class="line"> </span><br><span class="line">random <span class="comment">// 方法 返回一个 0 和 1 之间的伪随机数。</span></span><br><span class="line"> </span><br><span class="line">replace <span class="comment">// 方法 返回根据正则表达式进行文字替换后的字符串的拷贝。</span></span><br><span class="line"> </span><br><span class="line">reverse <span class="comment">// 方法 返回一个元素反序的 Array 对象。</span></span><br><span class="line"> </span><br><span class="line">round <span class="comment">// 方法 将一个指定的数值表达式舍入到最近的整数并将其返回。</span></span><br><span class="line"> </span><br><span class="line">search <span class="comment">// 方法 返回与正则表达式查找内容匹配的第一个子字符串的位置。</span></span><br><span class="line"> </span><br><span class="line">setDate <span class="comment">// 方法 使用当地时间设置 Date 对象的数值日期。</span></span><br><span class="line">  </span><br><span class="line">setFullYear <span class="comment">// 方法 使用当地时间设置 Date 对象的年份。</span></span><br><span class="line"> </span><br><span class="line">setHours <span class="comment">// 方法 使用当地时间设置 Date 对象的小时值。</span></span><br><span class="line"> </span><br><span class="line">setMilliseconds <span class="comment">// 方法 使用当地时间设置 Date 对象的毫秒值。</span></span><br><span class="line"> </span><br><span class="line">setMinutes <span class="comment">// 方法 使用当地时间设置 Date 对象的分钟值。</span></span><br><span class="line">  </span><br><span class="line">setMonth <span class="comment">// 方法 使用当地时间设置 Date 对象的月份。</span></span><br><span class="line">  </span><br><span class="line">setSeconds <span class="comment">// 方法 使用当地时间设置 Date 对象的秒值。</span></span><br><span class="line">  </span><br><span class="line">setTime <span class="comment">// 方法 设置 Date 对象的日期和时间。</span></span><br><span class="line"> </span><br><span class="line">setUTCDate <span class="comment">// 方法 使用全球标准时间（UTC）设置 Date 对象的数值日期。</span></span><br><span class="line"> </span><br><span class="line">setUTCFullYear <span class="comment">// 方法 使用全球标准时间（UTC）设置 Date 对象的年份。</span></span><br><span class="line"> </span><br><span class="line">setUTCHours <span class="comment">// 方法 使用全球标准时间（UTC）设置 Date 对象的小时值。</span></span><br><span class="line"> </span><br><span class="line">setUTCMilliseconds <span class="comment">// 方法 使用全球标准时间（UTC）设置 Date 对象的毫秒值。</span></span><br><span class="line"> </span><br><span class="line">setUTCMinutes <span class="comment">// 方法 使用全球标准时间（UTC）设置 Date 对象的分钟值。</span></span><br><span class="line"> </span><br><span class="line">setUTCMonth <span class="comment">// 方法 使用全球标准时间（UTC）设置 Date 对象的月份。</span></span><br><span class="line"> </span><br><span class="line">setUTCSeconds <span class="comment">// 方法 使用全球标准时间（UTC）设置 Date 对象的秒值。</span></span><br><span class="line"> </span><br><span class="line">setYear <span class="comment">// 方法 使用 Date 对象的年份。</span></span><br><span class="line"> </span><br><span class="line">shift <span class="comment">// 方法 删除数组中的第一个元素并返回该值。</span></span><br><span class="line"> </span><br><span class="line">sin <span class="comment">// 方法 返回一个数的正弦。</span></span><br><span class="line"> </span><br><span class="line">slice <span class="comment">// 方法 (Array) 返回数组的一个片段。</span></span><br><span class="line"> </span><br><span class="line">slice <span class="comment">// 方法 (String) 返回字符串的一个片段。</span></span><br><span class="line"> </span><br><span class="line">small <span class="comment">// 方法 将 HTML 的&lt;SMALL&gt; 标识添加到 String 对象中的文本两端。</span></span><br><span class="line"> </span><br><span class="line">sort <span class="comment">// 方法 返回一个元素被排序了的 Array 对象。</span></span><br><span class="line">  </span><br><span class="line">splice <span class="comment">// 方法 从数组中删除元素，若必要，在相应位置处插入新元素，返回被删除的元素。</span></span><br><span class="line"> </span><br><span class="line">split <span class="comment">// 方法 将一个字符串分割为子字符串，然后将结果作为字符串数组返回。</span></span><br><span class="line"> </span><br><span class="line">sqrt <span class="comment">// 方法 返回一个数的平方根。</span></span><br><span class="line"> </span><br><span class="line">strike <span class="comment">// 方法 将 HTML 的&lt;STRIKE&gt; 标识添加到String 对象中的文本两端。</span></span><br><span class="line"> </span><br><span class="line">sub <span class="comment">// 方法 将 HTML 的 &lt;SUB&gt; 标识放置到 String 对象中的文本两端。</span></span><br><span class="line"> </span><br><span class="line">substr <span class="comment">// 方法 返回一个从指定位置开始并具有指定长度的子字符串。</span></span><br><span class="line"> </span><br><span class="line">substring <span class="comment">// 方法 返回位于 String 对象中指定位置的子字符串。</span></span><br><span class="line">  </span><br><span class="line">sup <span class="comment">// 方法 将 HTML 的 &lt;SUP&gt; 标识放置到 String 对象中的文本两端。</span></span><br><span class="line"> </span><br><span class="line">tan <span class="comment">// 方法 返回一个数的正切。</span></span><br><span class="line"> </span><br><span class="line">test <span class="comment">// 方法 返回一个 Boolean 值，表明在被查找的字符串中是否存在某个模式。</span></span><br><span class="line"> </span><br><span class="line">toArray <span class="comment">// 方法 返回一个从 VBArray 转换而来的标准 JScript 数组。</span></span><br><span class="line"> </span><br><span class="line">toDateString <span class="comment">// 方法 返回以字符串形式表示的日期。</span></span><br><span class="line"> </span><br><span class="line">toExponential <span class="comment">// 方法 返回一个字符串，该字符串包含一个以指数形式表示的数字。</span></span><br><span class="line"> </span><br><span class="line">toFixed <span class="comment">// 方法 返回一个字符串，表明一个用 fixed-point 形式表示的数字。</span></span><br><span class="line"> </span><br><span class="line">toGMTString <span class="comment">// 方法 返回一个转换为使用格林威治标准时间（GMT）的字符串的日期。</span></span><br><span class="line">  </span><br><span class="line">toLocaleDateString <span class="comment">// 方法 返回一个以字符串形式表示的日期</span></span><br><span class="line"><span class="comment">//  该日期与主机环境的当前区域设置相适应。</span></span><br><span class="line"> </span><br><span class="line">toLocaleLowercase <span class="comment">// 方法 返回一个字符串，</span></span><br><span class="line"><span class="comment">// 其中所有的字母字符都被转换成小写（考虑主机环境的当前区域设置）。</span></span><br><span class="line"> </span><br><span class="line">toLocaleTimeString <span class="comment">// 方法 返回一个以字符串形式表示的时间，该时间与主机环境当前区域设置相适应。</span></span><br><span class="line"> </span><br><span class="line">toLocaleString <span class="comment">// 方法 返回一个转换为使用当地时间的字符串的日期。</span></span><br><span class="line"> </span><br><span class="line">toLocaleUppercase <span class="comment">// 方法 返回一个字符串，其中所有的字母字符都被转换成大写（考虑主机环境的当前区域设置）。</span></span><br><span class="line"> </span><br><span class="line">toLowerCase <span class="comment">// 方法 返回一个所有的字母字符都被转换为小写字母的字符串。</span></span><br><span class="line"> </span><br><span class="line">toPrecision <span class="comment">// 方法 返回一个字符串，</span></span><br><span class="line"><span class="comment">//  该字符串包含用指定位数的指数或 fixed-point 形式表示的数字。</span></span><br><span class="line"> </span><br><span class="line">toString <span class="comment">// 方法 返回一个对象的字符串表示。</span></span><br><span class="line"> </span><br><span class="line">toTimeString <span class="comment">// 方法 返回一个以字符串形式表示的时间。</span></span><br><span class="line"> </span><br><span class="line">toUpperCase <span class="comment">// 方法 返回一个所有的字母字符都被转换为大写字母的字符串。</span></span><br><span class="line"> </span><br><span class="line">toUTCString <span class="comment">// 方法 返回一个转换为使用全球标准时间（UTC）的字符串的日期。</span></span><br><span class="line"> </span><br><span class="line">ubound <span class="comment">// 方法 返回在 VBArray 的指定维中所使用的最大索引值。</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">unescape</span> <span class="comment">// 方法 对用escape // 方法编码的 String 对象进行解码。</span></span><br><span class="line">  </span><br><span class="line">unshift <span class="comment">// 方法 返回一个数组，在该数组头部插入了指定的元素。</span></span><br><span class="line"> </span><br><span class="line"><span class="variable constant_">UTC</span> <span class="comment">// 方法 返回 1970年1月1日零点的全球标准时间</span></span><br><span class="line">    <span class="comment">//（UTC） （或 GMT）与指定日期之间的毫秒数. </span></span><br><span class="line">valueOf <span class="comment">// 方法 返回指定对象的原始值。</span></span><br><span class="line"> </span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h3 id="Document"><a href="#Document" class="headerlink" title="Document"></a>Document</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable language_">document</span>.<span class="property">activeElement</span>  <span class="comment">// 返回当前获取焦点元素</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">addEventListener</span>() <span class="comment">// 向文档添加句柄</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">adoptNode</span>(node)    <span class="comment">// 从另外一个文档返回 adapded 节点到当前文档。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">anchors</span>    <span class="comment">// 返回对文档中所有 Anchor 对象的引用。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">baseURI</span>    <span class="comment">// 返回文档的绝对基础 URI</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">body</span>   <span class="comment">// 返回文档的body元素</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">close</span>()    <span class="comment">// 关闭用 document.open() 方法打开的输出流，并显示选定的数据。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">cookie</span> <span class="comment">// 设置或返回与当前文档有关的所有 cookie。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">createAttribute</span>()  <span class="comment">// 创建一个属性节点</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">createComment</span>()    <span class="comment">// createComment() 方法可创建注释节点。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">createDocumentFragment</span>()   <span class="comment">// 创建空的 DocumentFragment 对象，并// 返回此对象。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">createElement</span>()    <span class="comment">// 创建元素节点。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">createTextNode</span>()   <span class="comment">// 创建文本节点。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">doctype</span>    <span class="comment">// 返回与文档相关的文档类型声明 (DTD)。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">documentElement</span>    <span class="comment">// 返回文档的根节点</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">documentMode</span>   <span class="comment">// 返回用于通过浏览器渲染文档的模式</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">documentURI</span>    <span class="comment">// 设置或返回文档的位置</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">domain</span> <span class="comment">// 返回当前文档的域名。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">embeds</span> <span class="comment">// 返回文档中所有嵌入的内容（embed）集合</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">forms</span>  <span class="comment">// 返回对文档中所有 Form 对象引用。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">getElementsByClassName</span>()   <span class="comment">// 返回文档中所有指定类名的元素集合，作为 NodeList 对象。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">getElementById</span>()   <span class="comment">// 返回对拥有指定 id 的第一个对象的引用。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">getElementsByName</span>()    <span class="comment">// 返回带有指定名称的对象集合。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">getElementsByTagName</span>() <span class="comment">// 返回带有指定标签名的对象集合。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">images</span> <span class="comment">// 返回对文档中所有 Image 对象引用。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">implementation</span> <span class="comment">// 返回处理该文档的 DOMImplementation 对象。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">importNode</span>()   <span class="comment">// 把一个节点从另一个文档复制到该文档以便应用。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">inputEncoding</span>  <span class="comment">// 返回用于文档的编码方式（在解析时）。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">lastModified</span>   <span class="comment">// 返回文档被最后修改的日期和时间。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">links</span>  <span class="comment">// 返回对文档中所有 Area 和 Link 对象引用。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">normalize</span>()    <span class="comment">// 删除空文本节点，并连接相邻节点</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">normalizeDocument</span>()    <span class="comment">// 删除空文本节点，并连接相邻节点的</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">open</span>() <span class="comment">// 打开一个流，以收集来自任何 document.write() 或 document.writeln() 方法的输出。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">querySelector</span>()    <span class="comment">// 返回文档中匹配指定的CSS选择器的第一元素</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">querySelectorAll</span>() <span class="comment">// 是 HTML5中引入的新方法，// 返回文档中匹配的CSS选择器的所有元素节点列表</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">readyState</span> <span class="comment">// 返回文档状态 (载入中……)</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">referrer</span>   <span class="comment">// 返回载入当前文档的文档的 URL。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">removeEventListener</span>()  <span class="comment">// 移除文档中的事件句柄(由 addEventListener() 方法添加)</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">renameNode</span>()   <span class="comment">// 重命名元素或者属性节点。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">scripts</span>    <span class="comment">// 返回页面中所有脚本的集合。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">strictErrorChecking</span>    <span class="comment">// 设置或返回是否强制进行错误检查。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">title</span>  <span class="comment">// 返回当前文档的标题。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="property">URL</span>    <span class="comment">// 返回文档完整的URL</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">write</span>()    <span class="comment">// 向文档写 HTML 表达式 或 JavaScript 代码。</span></span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">writeln</span>()  <span class="comment">// 等同于 write() 方法，不同的是在每个表达式之后写一个换行符。</span></span><br><span class="line"><span class="comment">// ————————————————</span></span><br><span class="line"><span class="comment">// 日期:2021-03-25</span></span><br><span class="line"><span class="comment">// 参考链接：https://www.runoob.com/jsref/dom-obj-document.html</span></span><br></pre></td></tr></table></figure>



<h2 id="Jquery"><a href="#Jquery" class="headerlink" title="Jquery"></a>Jquery</h2><h3 id="代替js字符拼接"><a href="#代替js字符拼接" class="headerlink" title="代替js字符拼接"></a>代替js字符拼接</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="string">&#x27;&lt;div/&gt;&#x27;</span>,&#123;</span><br><span class="line">    <span class="attr">text</span>: <span class="string">&#x27;Div text&#x27;</span>,</span><br><span class="line">    <span class="attr">class</span>: <span class="string">&#x27;className&#x27;</span></span><br><span class="line">&#125;).<span class="title function_">appendTo</span>(<span class="string">&#x27;#parentDiv&#x27;</span>);</span><br><span class="line">————————————————</span><br><span class="line">日期:<span class="number">2020</span>/<span class="number">10</span>/<span class="number">22</span></span><br><span class="line">参考链接：<span class="attr">https</span>:<span class="comment">//stackoverflow.com/questions/268490/jquery-document-createelement-equivalent</span></span><br></pre></td></tr></table></figure>

<h2 id="表单重置"><a href="#表单重置" class="headerlink" title="表单重置"></a>表单重置</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//在form表单中添加一个隐藏的reset按钮， </span></span><br><span class="line">&lt;button type=<span class="string">&quot;reset&quot;</span> style=<span class="string">&quot;display:none;&quot;</span>&gt;&lt;/button&gt; </span><br><span class="line"><span class="comment">//然后通过trigger来触发reset按钮 </span></span><br><span class="line">$(<span class="string">&quot;button[type=&#x27;reset&#x27;]&quot;</span>).<span class="title function_">trigger</span>(<span class="string">&quot;click&quot;</span>);<span class="comment">//触发reset按钮 //通过form表单的dom对象的reset方法来清空$(&#x27;form&#x27;)[0].reset();</span></span><br><span class="line">————————————————</span><br><span class="line">日期:<span class="number">2021</span>-<span class="number">11</span>-<span class="number">01</span></span><br><span class="line">参考链接：<span class="attr">https</span>:<span class="comment">//blog.csdn.net/biedazhangshu/article/details/50731295</span></span><br></pre></td></tr></table></figure>



<h2 id="Layui"><a href="#Layui" class="headerlink" title="Layui"></a>Layui</h2><h3 id="layui清空-重置表单数据的数据"><a href="#layui清空-重置表单数据的数据" class="headerlink" title="layui清空,重置表单数据的数据"></a>layui清空,重置表单数据的数据</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">layui.form.render();</span><br></pre></td></tr></table></figure>


    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/js/" rel="tag"># js</a>
              <a href="/tags/html/" rel="tag"># html</a>
              <a href="/tags/css/" rel="tag"># css</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/20200727-Java_cuo_wu_ji_he/" rel="prev" title="Java错误集合">
                  <i class="fa fa-chevron-left"></i> Java错误集合
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/20200808-android_cuo_wu_bi_ji/" rel="next" title="android错误笔记">
                  android错误笔记 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






    
  <div class="comments" id="disqus_thread">
    <noscript>Please enable JavaScript to view the comments powered by Disqus.</noscript>
  </div>
  
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">JackCh3n</span>
</div>
<div class="busuanzi-count">
    <span class="post-meta-item" id="busuanzi_container_site_uv">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="Total Visitors">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-item" id="busuanzi_container_site_pv">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="Total Views">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/" rel="noopener" target="_blank">NexT.Gemini</a>
  </div>
    <br/>Powerful CDN service provided by 
  <a target="_blank" rel="noopener" href="https://www.upyun.com/?utm_source=lianmeng&utm_medium=referral" style="border:none"><img src="https://www.wulihub.com.cn/gc/Wez0VG/images/upyun_logo.png" height="66" style="display: list-item;" alt="upyun"></a> 
  <a target="_blank" rel="noopener" href="https://www.jsdelivr.com" style="border:none"><img src="https://www.wulihub.com.cn/gc/Wez0VG/images/jsdelivr_logo.svg" height="50" style="display: list-item;" alt="JsDelivr"></a>
  <p>
  <br/><a target="_blank" rel="noopener" href="https://pages.github.com/?f=nobige">Github Pages</a>&nbsp;&nbsp;<a target="_blank" rel="noopener" href="https://vercel.com/?f=nobige">Vercel</a>&nbsp;&nbsp;<a target="_blank" rel="noopener" href="https://www.netlify.com/?f=nobige">Netlify</a>&nbsp;&nbsp;<a target="_blank" rel="noopener" href="https://coding.net/?f=nobige">coding</a>&nbsp;&nbsp;provides static publishing
  </p>

    </div>
  </footer>

  
  <script src="https://npm.elemecdn.com/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="https://www.wulihub.com.cn/gc/Wez0VG/js/comments.js"></script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/utils.js"></script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/motion.js"></script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/next-boot.js"></script>

  
<script src="https://npm.elemecdn.com/hexo-generator-searchdb@1.4.0/dist/search.js" integrity="sha256-vXZMYLEqsROAXkEw93GGIvaB2ab+QW6w3+1ahD9nXXA=" crossorigin="anonymous"></script>
<script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/search/local-search.js"></script>





  
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>




<link rel="stylesheet" href="https://npm.elemecdn.com/disqusjs@1.3.0/dist/disqusjs.css" integrity="sha256-GxdCIOyfxQ1OBfS99qAIJDoGK1ADuBsxhMTqXG82fAY=" crossorigin="anonymous">

<script class="next-config" data-name="disqusjs" type="application/json">{"enable":true,"api":"https://duosuo.nobige.cn/","apikey":"Kmo9kPwsir7ppp8tGpeGROCmUtW8tdZBOdBVowPC67xVfTS5uV1wr6s4kckvP95m","shortname":"nobige","js":{"url":"https://npm.elemecdn.com/disqusjs@1.3.0/dist/disqus.js","integrity":"sha256-LVaMHPQ2zLqOc5rXSAfr4d1PIkEGNLyyUTDNPZmTtUw="}}</script>
<script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/comments/disqusjs.js"></script>

</body>
</html>
